Last post Nov 02, 2011 07:29 AM by Srikanth Kasturi
Oct 31, 2011 12:31 AM|androcles74|LINK
Do you know of any way to display in the header the sorting criteria the user has selected? Can that be accessed programatically?
For example, if I have Column1, Column2, ... Column9 and the user multiselects Column2 and Column5, ideally I'd like to display "Sorted by Column2 descending and Column5 ascending". If this is not possible, is there a way to highlight which columns were
used for sorting?
Oct 31, 2011 01:58 AM|kamalchhabra|LINK
yes,By using the that Column id
we can highlight that column
private string ConvertSortDirectionToSql(SortDirection sortDireciton)
string m_SortDirection = String.Empty;
m_SortDirection = "ASC";
m_SortDirection = "DESC";
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
DataTable m_DataTable = GridView1.DataSource as DataTable;
if (m_DataTable != null)
DataView m_DataView = new DataView(m_DataTable);
m_DataView.Sort = e.SortExpression + " " + ConvertSortDirectionToSql(e.SortDirection);
GridView1.DataSource = m_DataView;
Oct 31, 2011 04:04 AM|androcles74|LINK
Thanks for the answer. Does this solution (or a similar one) apply within SSRS?
Oct 31, 2011 06:33 AM|kamalchhabra|LINK
It works on SSRS
Nov 02, 2011 07:29 AM|Srikanth Kasturi|LINK
Right click on the column and select Properties --> Interactive Sorting -- > Sort By <Criteria>
By default, the sorted column highlights itself with an arrow facing the direction of the sort.