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

Resort does not occur when item changes

2 Answers 53 Views
JumpList
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
John
Top achievements
Rank 1
John asked on 08 Mar 2012, 06:38 PM
The ItemsSource property of my RadJumpList is bound to an ObservableCollection property called OC. Whenever an item contained in the ObservableCollection changes I make sure to call PropertyChanged("OC"). Since the RadJumpList is bound to the OC property, and I'm calling PropertyChanged("OC") on my object, the RadJumpList should update the list whenever an item in the ObservableCollection changes.

This works correctly in all cases except for sorting. I'm sorting the RadJumpList by the Name property of the items contained in the ObservableCollection, but whenever the Name property changes and I call PropertyChanged("Name") the list does not resort. The list refreshes so that the new name is displayed, but it does not resort.

Should resorting happen automatically? How can I force a resort programmatically?

2 Answers, 1 is accepted

Sort by
0
Accepted
Deyan
Telerik team
answered on 09 Mar 2012, 08:42 AM
Hello John,

Thanks for contacting us and for your question.

If you are using a GenericSortDescriptor to sort RadJumpList, please make sure that you have initialized its KeyName property with the name of the property you are sorting by. For instance:

GenericSortDescriptor<MyTestObject, string> sd = new GenericSortDescriptor<MyTestObject, string>();
sd.KeyName = "Name";
sd.KeySelector = (MyTestObject obj) =>
{
    return obj.Name;
};

I hope this helps.

Let me know in case you have further questions or need assistance.

Regards,
Deyan
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
John
Top achievements
Rank 1
answered on 09 Mar 2012, 03:00 PM
That works perfectly. Thanks.
Tags
JumpList
Asked by
John
Top achievements
Rank 1
Answers by
Deyan
Telerik team
John
Top achievements
Rank 1
Share this question
or