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

[Solved] Custom sort

2 Answers 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Silderado
Top achievements
Rank 1
Silderado asked on 15 Jan 2010, 06:46 PM
Hi, I need help. After making the ordering of the grid I need to get this data from the modified datatable, how can I do??

I am passing the values to sort through the code below:

        GridSortExpression expression = new GridSortExpression ();
        
expression.FieldName = "ds2";
        
this.RgDados.MasterTableView.SortExpressions.AddSortExpression (expression);
        
this.RgDados.MasterTableView.Rebind ();

        
DataTable dt = (DataTable) RgDados.MasterTableView.DataSource;
        
Session [ "Data"] = dt;

2 Answers, 1 is accepted

Sort by
0
Silderado
Top achievements
Rank 1
answered on 18 Jan 2010, 10:41 AM
nobody ??
0
Yavor
Telerik team
answered on 21 Jan 2010, 07:25 AM
Hello Silderado,

The sorting/grouping operations of the control will not be reflected in the underlying datasource. Hence, if you would like to retrieve the records, while also keeping in mind the grouping applied this far, you will need to re-query the underlying datasource, by applying the relevant groupBy/Order clauses.
I hope this information helps.

Sincerely yours,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Silderado
Top achievements
Rank 1
Answers by
Silderado
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or