Results 1 to 3 of 3

Thread: Searching Combobox item by valuemember

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    115

    Searching Combobox item by valuemember

    Hi


    is it poseble to Search Combobox item by valuemember in TextChanged


    Sample Combobox I use with multi-columns

    https://www.codeproject.com/Articles...olumn-combobox


    Thanks
    ssalomon

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Searching Combobox item by valuemember

    You can simply set the ValueMember property to select the corresponding item in the control. If you just want to find the item rather than select then no, there's no way to do that built into the control. You would have to do it via the data source with knowledge of the type of the items. There is a more general way, using PropertyDescriptors, but that is convoluted and inefficient and not something you would want to do unless you were building a custom control with that generalised functionality. Using PropertyDescriptors is how the ValueMember/SelectedValue properties work in the first place. That's how you can specify the name of a DataColumn as the ValueMember when binding a DataTable.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    115

    Re: Searching Combobox item by valuemember

    Thanks jmcilhinney

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width