This is a migrated thread and some comments may be shown as answers.

Programatically determine current sort order of radgrid

1 Answer 272 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kermit
Top achievements
Rank 1
Kermit asked on 30 Oct 2012, 08:27 PM
Is there a way to determine the current sort order of a radgrid, or do I have to keep track of it myself whenever a column header is clicked?

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 31 Oct 2012, 05:42 AM
Hi,

You can set the sort order programmatically as follows.

C#:
protected void Page_Load(object sender, EventArgs e)
{
    GridSortExpression ge = new GridSortExpression();
    ge.FieldName = "OrderID";
    ge.SortOrder = GridSortOrder.Descending;
    RadGrid1.MasterTableView.SortExpressions.Add(ge);
    RadGrid1.MasterTableView.Rebind();
}

Thanks,
Princy.
Tags
Grid
Asked by
Kermit
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or