Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




How to use ORDERBY on RowFilter in Asp.Net

Requirement: Where Rows need to show Order wise Ascending or descending in code behind. e.g we are receiving a dataset from database and want to show records in ascending or Descending wise on basis of any column. So we will write the column name in sort order.

if (ds.Tables[0].Rows.Count > 0)
{
DataView dv = new DataView();
dv = ds.Tables[0].DefaultView;
dv.Sort = " AdminMessageId Desc ";
dlAdminMessage.DataSource = dv;
dlAdminMessage.DataBind();
}
Share this article   |    Print    |    Article read by 5332 times
Author:
Rohit kakria
I am software developer
Related Articles:
Related Interview Questions: