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

Client Sort Adds a Second Sort Icon

4 Answers 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
LeBear
Top achievements
Rank 1
LeBear asked on 04 Mar 2010, 09:43 PM
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.

4 Answers, 1 is accepted

Sort by
0
Wolfgang Kamir
Top achievements
Rank 1
answered on 08 Mar 2010, 04:53 PM
Same issue here... is there any workaround?

Kind regards,
Wolfgang
0
Iana Tsolova
Telerik team
answered on 09 Mar 2010, 02:32 PM
Hi,

Could you please confirm that your grid is bound client-side? 
In order to sort the grid initially in this case, I suggest that you do it on the client by passing the desired sort expression as you would do it on subsequent sort command.

Kind regards,
Iana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
LeBear
Top achievements
Rank 1
answered on 09 Mar 2010, 03:27 PM
It's definitely bound client-side (hard to confuse the two).  My goal is to provide an initial sort on the server, and then let the user sort however they like.

Yes, what you suggest is a good workaround, and in fact is what I am currently doing.

However, this is an implementation within a portal.  Each gadget on the portal has an option to load while the page loads or to defer loading until after the page loads - i.e., via Ajax.  I'd like to be able to honor that.

What I would prefer is a resolution first to the sort indicator in the headers, and second to the application of the skin sort styles.
0
Iana Tsolova
Telerik team
answered on 09 Mar 2010, 04:06 PM
Hello LeBear,

Please not that having declarative (or server-side) sort expressions for client-side bound page/grid are not supported. So if you want the grid sorted initially, you will need to fire the sort command on initial load as previously suggested.
However if you can share the problematic page code with us, we will try investigating the issue in your case further and see if we can find a proper resolution for you.

Regards,
Iana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
LeBear
Top achievements
Rank 1
Answers by
Wolfgang Kamir
Top achievements
Rank 1
Iana Tsolova
Telerik team
LeBear
Top achievements
Rank 1
Share this question
or