Sorting Listbox by ValueMember

5 posts, 0 answers
  1. jerry
    jerry avatar
    103 posts
    Member since:
    Feb 2008

    Posted 16 Feb 2010 Link to this post

    Is it possible with your controls to sort my Listbox by the Valuemember not the Displaymember?

    Thank You
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 17 Feb 2010 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. jerry
    jerry avatar
    103 posts
    Member since:
    Feb 2008

    Posted 17 Feb 2010 Link to this post

    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
  5. Vassil Petev
    Admin
    Vassil Petev avatar
    1765 posts

    Posted 17 Feb 2010 Link to this post

    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.
  6. jerry
    jerry avatar
    103 posts
    Member since:
    Feb 2008

    Posted 17 Feb 2010 Link to this post

    Vassil,
    Thank you so much for the quick reply.

    I will dedicate some time to investigate. 

    Thank You
    Jerry
Back to Top
UI for WinForms is Visual Studio 2017 Ready