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

Sorting and grouping does not work anymore

3 Answers 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ewald
Top achievements
Rank 1
Ewald asked on 25 Sep 2011, 08:33 PM
I am building up the grid dynamically based on metadata. When I started building the grid, the sorting and grouping worked. Then after some time I found out that it is not working anymore. When I click on the column header, the SortCommand event is not raised. I checked that the AllowSorting property is set to true.

I tried to find out what caused the sorting to stop working, but cannot find it. What could cause this?

PS I use the __EVENTARGS in a postback to indicate what action the user wants to be performed. Do you use that too?

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 26 Sep 2011, 05:47 AM
Hello Ewald,

I suppose you are binding the grid using Simple data binding technique. If you are using any advanced feature in grid(like paging), then a better approach is binding RadGrid using "AdvancedData binding" using NeedDataSource event.

For more information about this can be available here.
Advanced Data-binding (using NeedDataSource event).
Grid / Advanced Data Binding.

Thanks,
Shinu.
0
Ewald
Top achievements
Rank 1
answered on 26 Sep 2011, 09:40 AM
I already use the advanced data binding because I have my custom paging logic. Sorting and grouping worked with this construction already. So that did not cause it.

My question is more what happens if a user clicks on a column header when he is sorting. How does the grid knows it has to sort on a column on postback?
0
Ewald
Top achievements
Rank 1
answered on 15 Oct 2011, 06:11 PM
I found the solution. I changed the ID of the grid on every postback. Giving it the same ID on every postback solved the issue
Tags
Grid
Asked by
Ewald
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ewald
Top achievements
Rank 1
Share this question
or