Client Sort Adds a Second Sort Icon

5 posts, 0 answers
  1. LeBear
    LeBear avatar
    233 posts
    Member since:
    May 2006

    Posted 04 Mar 2010 Link to this post

    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.
  2. Wolfgang Kamir
    Wolfgang Kamir avatar
    80 posts
    Member since:
    Jul 2006

    Posted 08 Mar 2010 Link to this post

    Same issue here... is there any workaround?

    Kind regards,
    Wolfgang
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 09 Mar 2010 Link to this post

    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.
  5. LeBear
    LeBear avatar
    233 posts
    Member since:
    May 2006

    Posted 09 Mar 2010 Link to this post

    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.
  6. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 09 Mar 2010 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017