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

Can I sort the Grid after binding?

2 Answers 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 17 Dec 2010, 05:22 PM
Hi,

Can I sort the Grid after binding? For example: I have the Datasource with 50 rows and bind it to Grid (10 rows per page). After binding, I want to sort on specific field and only on the specific page of the Grid, can I do that?

Thanks a lot
Dan

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin
Telerik team
answered on 22 Dec 2010, 02:44 PM
Hi Dan,

The grid normally sorts using all the items in the datasource and applies the sort expression to all of them. Sorting only for specific page is not standard scenario and is not supported by RadGrid.
If you need to apply yours, specific sorting functionality you can use the Custom Sorting for the grid but this way you will need to handle the sorting operations manually and provide specific logic that sorts only this part of the items that is on the current page.
Another option is to implement custom paging for the grid and bind it to specific amount of items, e.g. as the PageSize is. Thus upon sorting, only the items on the current page will be sorted.

Kind regards,
Marin
the Telerik team
Browse the vast support resources we have to jump start 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
Dan
Top achievements
Rank 1
answered on 24 Dec 2010, 03:36 AM
Thanks Marin
Tags
Grid
Asked by
Dan
Top achievements
Rank 1
Answers by
Marin
Telerik team
Dan
Top achievements
Rank 1
Share this question
or