sorting a listview like a grid

7 posts, 0 answers
  1. Dave
    Dave avatar
    36 posts
    Member since:
    Jan 2008

    Posted 15 Jun 2011 Link to this post

    I have looked at the basic sorting example but I would prefer not to have the sort mechanism be triggered from controls outside of the listview. I have my listview set up to mimic the look and feel of a RadGrid using the predefined layout for grids. Is there any way to set up the sorting such that users can simply click on the headers in my listview (and also show the up/down arrow) to initiate the sorting process? I would like the sorting of my listview to be exactly like this. Is this possible?
  2. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 21 Jun 2011 Link to this post

    Hello Dave,

    You could try adding a link button inside the <th> elements of the LayoutTemplate and handle their server Click event. There, you could fire a sort command for the listview :
    Firing command events from code

    Best wishes,
    Tsvetina
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dave
    Dave avatar
    36 posts
    Member since:
    Jan 2008

    Posted 12 Jul 2011 Link to this post

    I followed your advice, but the sorting wasn't working. I was banging my head against a wall until I decided to check the latest internal build and I noticed that the internal build for 7/1 mentions a bug fix for the listview ("FIX RadListView sorting issue when paging is enabled and the listview is bound to an EntityFramework context through NeedDataSource event "). Sure enough, I turned off paging and now the sorting is working. So, the question is: when is the next official release of the radcontrols for asp.net ajax going to be released? I'd rather not use an internal build in my production environment.
  5. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 13 Jul 2011 Link to this post

    Hello Dave,

    As you have probably already seen, Q2 2011 has just been release. You can download it from your account and test your project against it. Let us know if you notice any other issues with this functionality.

    All the best,
    Tsvetina
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  6. Dave
    Dave avatar
    36 posts
    Member since:
    Jan 2008

    Posted 13 Jul 2011 Link to this post

    The sorting is working well now in my radlistview. Thank you. I am using the FireCommandEvent method.
  7. Dave
    Dave avatar
    36 posts
    Member since:
    Jan 2008

    Posted 20 Jul 2011 Link to this post

    Is there any way that I can add an up/down arrow and change the background color of the column currently being sorted on in my radlistview (just like the RadGrid does)?
  8. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 25 Jul 2011 Link to this post

    Hi Dave,

    Note that RadListView is build by templates and you could put whatever images you want in this templates. In order to show images in the current sorted column you could show this images conditionally based on the sort expression on the server for example. Please see the following demo which presents how you could add image in the RadListView templates:
    http://demos.telerik.com/aspnet-ajax/listview/examples/sorting/customsorting/defaultcs.aspx

    Kind regards,
    Maria Ilieva
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017