I've just (finally!) implemented a client-side Ajax refresh to a RadGrid. This is very cool!
I wanted to handle client-side sorting via Ajax without triggering a postback. I did this by adding an "OnCommand" client event. I check to see if the command name is "Sort". If it is, I do a set_cancel(true) so there's no postback, then I simply call the Javascript routine that triggers the Ajax refresh. Since it's already passing filter/sort data, it works great! The sort information is passed to the web service where I sort the data, and the data comes back sorted. The grid even updates the column header with the sort icon.
The problem occurs when I have an initial sort on the grid on the server. The page loads with the grid populated and sorted. If I click on the already sorted column, it does the client-side routine to sort, but it adds a SECOND sort icon. No matter what I do, that original sort icon is already there. It acts as though it's part of the label.
Related to this, I had to set EnableSkinSortStyles to false as the style was applied to the originally sorted column and didn't change as the sort column changed.
Is there a way to address these issues?
Thank you.
I wanted to handle client-side sorting via Ajax without triggering a postback. I did this by adding an "OnCommand" client event. I check to see if the command name is "Sort". If it is, I do a set_cancel(true) so there's no postback, then I simply call the Javascript routine that triggers the Ajax refresh. Since it's already passing filter/sort data, it works great! The sort information is passed to the web service where I sort the data, and the data comes back sorted. The grid even updates the column header with the sort icon.
The problem occurs when I have an initial sort on the grid on the server. The page loads with the grid populated and sorted. If I click on the already sorted column, it does the client-side routine to sort, but it adds a SECOND sort icon. No matter what I do, that original sort icon is already there. It acts as though it's part of the label.
Related to this, I had to set EnableSkinSortStyles to false as the style was applied to the originally sorted column and didn't change as the sort column changed.
Is there a way to address these issues?
Thank you.