Can you find items by value?

3 posts, 0 answers
  1. Bex
    Bex avatar
    53 posts
    Member since:
    Jul 2011

    Posted 04 Mar 2009 Link to this post

    Hello

    This is the first time using a windows forms combobox and am trying to find an item by value like I did with a web drop down but can't seem to do it.
    What do I need to do to do this with a window combo?

    Thanks

    Bex
  2. Nikolay
    Admin
    Nikolay avatar
    1804 posts

    Posted 07 Mar 2009 Link to this post

    Hello Becky,

    Thank you for your interest in our products.

    Currently, you cannot find an item by its value out of the box. However, you can easily implement your own FindByValue method. I made such sample implementation for you:
    private RadComboBoxItem FindByValue(RadComboBox radComboBox, object value)  
    {  
        foreach (RadComboBoxItem item in radComboBox.Items)  
        {  
            if (item.Value.Equals(value))  
            {  
                return (RadComboBoxItem)item;  
            }  
        }  
     
        return null;  

    I am attaching a sample project to demonstrate this method in use. If you have additional questions, feel free to contact me.

    Regards,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Bex
    Bex avatar
    53 posts
    Member since:
    Jul 2011

    Posted 09 Mar 2009 Link to this post

    Hi Nikolay!

    Thanks for yor help!

    Bex
Back to Top