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

Sort Order Using RadGrid.GetBindingData

4 Answers 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
VIjay
Top achievements
Rank 1
VIjay asked on 18 Nov 2014, 03:08 PM
Hi All,

I have IList<Class1>. My Class1 has two property. Say Name and ID Now I want. Dynamic Order By On Both Property.
OrderBy Should Be Ascending or Descending.

How can I achieve this functionality.

I am using this as            
var data = RadGrid.GetBindingData(retval.AsQueryable(), startIndex, maximumRows, sortBy, filterExpressions);

in sort by it only take the property name. so how can specify the sort order.

Please Help

Regards
Vijay



4 Answers, 1 is accepted

Sort by
0
VIjay
Top achievements
Rank 1
answered on 19 Nov 2014, 08:49 AM
can anyone from telerik help with this?
0
VIjay
Top achievements
Rank 1
answered on 20 Nov 2014, 05:13 AM
Is My issue is very complex???
0
VIjay
Top achievements
Rank 1
answered on 20 Nov 2014, 05:14 AM
Is My Question is very complex
0
Angel Petrov
Telerik team
answered on 21 Nov 2014, 12:34 PM
Hi VIjay,

I am not sure about the exact implementation but I suppose that you are following the approach illustrated here. If that is the case you can set the MasterTableView.AllowMultiColumnSorting property to true as demonstrated below.

ASPX:
<MasterTableView AllowMultiColumnSorting="true">
With the above setup you will force the grid to pass both sort criteria to the web service. Later according to them you can sort the data and return the respective set of records. Bear in mind that both sort expressions will be available in the sortExpression parameter that the GetDataAndCount method from the demo receives.


Regards,
Angel Petrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
VIjay
Top achievements
Rank 1
Answers by
VIjay
Top achievements
Rank 1
Angel Petrov
Telerik team
Share this question
or