Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > ComboBox and ListBox (obsolete as of Q2 2010) > Can you find items by value?

Not answered Can you find items by value?

Feed from this thread
  • Bex avatar

    Posted on Mar 4, 2009 (permalink)

    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

    Reply

  • Nikolay Nikolay admin's avatar

    Posted on Mar 7, 2009 (permalink)

    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.
    Attached files

    Reply

  • Bex avatar

    Posted on Mar 9, 2009 (permalink)

    Hi Nikolay!

    Thanks for yor help!

    Bex

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > ComboBox and ListBox (obsolete as of Q2 2010) > Can you find items by value?
Related resources for "Can you find items by value?"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]