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

Simple Sorting

3 Answers 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Todd
Top achievements
Rank 1
Iron
Todd asked on 04 Apr 2011, 08:01 PM
Is it possible to just enable sorting on the grid and then allow the users to sort the data in the grid, without having to add any code, behind the scenes? 

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Apr 2011, 04:14 AM
Hello Todd,

You can set AllowSorting property to 'true' to  support basic sorting in RadGrid.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server"  AllowSorting="true">

Check out the following documentation.
Basic sorting

Thanks,
Princy.
0
Todd
Top achievements
Rank 1
Iron
answered on 05 Apr 2011, 01:07 PM
That's what I thought, I thought it should be that simple, but when I do that and click on the header to sort it my whole grid goes away and doesn't come back.  I was wondering if I had to write my own sort handler, but that seemed like a lot of work just to do a simple asc or desc sort.
0
Accepted
Princy
Top achievements
Rank 2
answered on 06 Apr 2011, 08:23 AM
Hello Todd,

I assume that you are binding the grid in PageLoad event, which is Simple data binding technique. If you are using any advanced feature in grid(like sorting), then a better approach is using "AdvancedData binding" using NeedDataSource event. Set the DataSource in NeedDataSource event and set the AllowSorting property of RadGrid to True. RadGrid fires the NeedDataSource event each time it needs to be bound to a data source. For more information about this can be available here:
Grid / Advanced Data Binding
Advanced Data-binding (using NeedDataSource event)

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