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

Sorting RadGrid with ObjectDataSource and List<Obejct>

7 Answers 279 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 10 Dec 2009, 11:51 AM
Hello Telerik-team

I'm trying to use the RadGrid with an ObjectDataSource which delivers the Data in a List<Object>.

We can see the data in the RadGrid and paging is working fine.

But we can't sort the data. We get the error.

Die Datenquelle "odsdata" unterstützt das Sortieren von IEnumerable-Daten nicht. Die automatische Sortierung wird nur für DataView, DataTable und DataSet unterstützt.
or translated in english:

The datasource "odsdata" does not support the Sorting of IEnumerable-Data. The automatic sorting is only supported for DataView ...


In our software architectur we have to work with list<object> and the ObjectDataSource.

I tried to use the RadGrid OnSortCommand-Event, but I can't bind the sortet list<object> because I use the DataSourceID of the ObjectDataSource and can#t rebind the Data.

Are there any idea to solve the problem?

Christian

7 Answers, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 10 Dec 2009, 12:21 PM
Hi Christian,

Actually the error you have described is not related to RadGrid, but it is thrown by the ObjectDataSource as it does not support sorting on IEnumerable. However you can workaround this behavior be setting RadGrid MasterTableView's OverrideDataSourceControlSorting property to true.

Regards,
Rosen
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.
0
Christian
Top achievements
Rank 1
answered on 10 Dec 2009, 12:40 PM
Thanks!

Christian
0
rajesh
Top achievements
Rank 1
answered on 19 Nov 2010, 12:34 AM
hi telerik team

i am also using object datasource and i tried with OverrideDataSourceControlSorting property to true.
But it showing an error.please help me to sort the grid
0
Nikolay Rusev
Telerik team
answered on 19 Nov 2010, 10:02 AM
Hello Rajesh,

Please provide more details on your case.

All the best,
Nikolay
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Matthias Heinrich
Top achievements
Rank 2
answered on 13 Jan 2012, 03:36 PM
Workaround works like charm! THX!
0
TechSavvySam
Top achievements
Rank 1
answered on 16 Nov 2012, 11:52 AM
Thanks.  worked for me too :)
0
Nathan
Top achievements
Rank 1
answered on 28 Sep 2014, 05:08 AM
This - this right here. Just saved me HOURS of work on a Sunday afternoon. <3 your work telerik bros.
Tags
Grid
Asked by
Christian
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Christian
Top achievements
Rank 1
rajesh
Top achievements
Rank 1
Nikolay Rusev
Telerik team
Matthias Heinrich
Top achievements
Rank 2
TechSavvySam
Top achievements
Rank 1
Nathan
Top achievements
Rank 1
Share this question
or