SortDescriptions example? (Dynamic sorting of a RadDataboundListBox)

4 posts, 0 answers
  1. Robert
    Robert avatar
    5 posts
    Member since:
    Apr 2013

    Posted 30 Apr 2013 Link to this post

    If SortDescriptions is not the correct term or my strategy is wrong here just tell me the right technique, I'm new at this.

    I have a RadDataboundListBox bound to an ObservableCollection in my view model.  I want to give the user the ability to sort the list items by different properties provided by the collection member object.  I've done a fair amount of Web searching to find a good sample that shows me how to do this and I have come up empty-handed.

    Is the use of SortDescriptions the right way to get this done?  Or should I create relay commands for each sort type and bind them to buttons on the host page, and then have the view model sort the actual collection directly subsequently?

    If SortDescriptions is the way to go, please link me to a good sample I can follow.

    If I should sort the ObservableCollection directly from the view model, will doing this implicitly raise a property changed event to notify the RadDataboundListBox, or should I raise it explicitly myself?

    Thanks,
    Robert
  2. Todor
    Admin
    Todor avatar
    778 posts

    Posted 03 May 2013 Link to this post

    Hi Robert,

    Thank you for contacting us.

    RadJumpList has a property SortDescriptors, which is created to allow you to sort the collection, so I suggest that you use it, instead of bothering to sort the collection separately. I've made a small sample to show you how to handle the sort descriptors collection in bound mode, which is better explained here. Of course, you can choose to modify the descriptors directly, and not by binding, or you can choose to do this with commands, instead of events, apply more than one sorting in the same time, etc., but the example aims to show you the basics of RadJumpList's sorting capabilities.

    I hope it is helpful.

    All the best,
    Todor
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
  4. Robert
    Robert avatar
    5 posts
    Member since:
    Apr 2013

    Posted 03 May 2013 Link to this post

    Thanks Todor!  I'm downloading your example now.

    -- roschler
  5. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 06 May 2013 Link to this post

    Hello Robert,

    We will consider this thread closed for now.

    Feel free to reopen in in case of further questions.

    All the best,
    Deyan
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top