|
-
Jan 27th, 2019, 04:01 PM
#1
Thread Starter
Lively Member
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
-
Jan 27th, 2019, 05:44 PM
#2
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.
-
Feb 3rd, 2019, 04:36 AM
#3
Thread Starter
Lively Member
Re: Searching Combobox item by valuemember
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|