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

SortDescriptions example? (Dynamic sorting of a RadDataboundListBox)

3 Answers 50 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Robert
Top achievements
Rank 1
Robert asked on 30 Apr 2013, 08:28 AM
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

3 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 03 May 2013, 08:47 AM
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.
0
Robert
Top achievements
Rank 1
answered on 03 May 2013, 11:52 AM
Thanks Todor!  I'm downloading your example now.

-- roschler
0
Deyan
Telerik team
answered on 06 May 2013, 07:14 AM
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.
Tags
DataBoundListBox
Asked by
Robert
Top achievements
Rank 1
Answers by
Todor
Telerik team
Robert
Top achievements
Rank 1
Deyan
Telerik team
Share this question
or