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

Sorting Listbox by ValueMember

4 Answers 90 Views
ComboBox and ListBox (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
jerry
Top achievements
Rank 1
jerry asked on 16 Feb 2010, 08:13 PM
Is it possible with your controls to sort my Listbox by the Valuemember not the Displaymember?

Thank You

4 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 17 Feb 2010, 09:36 AM
Hi jerry,

Thank you for your question. There is no problem to sort by the ValueMember. All you need to do is to implement IComparer<T> interface and provide the implementation to one of the overloads of RadListBox.Items.Sort() method.

Please write again if you have other questions.

Best wishes,
Victor
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.
0
jerry
Top achievements
Rank 1
answered on 17 Feb 2010, 01:46 PM
Victor,
Do you have any example code or a demo of how this is done?
I've never worked with IComparer<T> and just wanted to make sure I go in the correct direction.

thank you so much
Jerry
0
Vassil Petev
Telerik team
answered on 17 Feb 2010, 04:25 PM
Hello jerry,

We do not have such implementations or code snippets which we can send you. Since the IComparer<T> interface is public, and is supported on .NET framework level, there might be some implementations on the internet. Feel free to check this with Google.

Also, MSDN (aka Microsoft Developer Network) should contain all the needed information to get you started. Check the link that we send you.


Kind regards,
Vassil
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.
0
jerry
Top achievements
Rank 1
answered on 17 Feb 2010, 04:32 PM
Vassil,
Thank you so much for the quick reply.

I will dedicate some time to investigate. 

Thank You
Jerry
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
jerry
Top achievements
Rank 1
Answers by
Victor
Telerik team
jerry
Top achievements
Rank 1
Vassil Petev
Telerik team
Share this question
or