-If given a Value member (e.g. customer primary key) find the corresponding display text (e.g. customer name) as it shows in the combo box.
So, say I have the following in a combo box where the first is the display text and second is the value member.
Andria Jensen - 5Trent Taylor - 10Ben Chase - 3
I should be able to find the text "Andria Jensen" from the combo box if I have the value 5. I know you can do this with the Text property if you are trying to get the currently selected text. However, what if I'm trying to get something that was previously selected? Say comparing an original to a current value.
I found this, but it doesn't seem to work correctly in all cases:ComboBoxCtl.Properties.GetDisplayText(EditValueToFind)
How would you guys go about accomplishing this?
I'd recommend that instead of using the devexpress ComboBoxEdit, you should use the devexpress LookupEdit. The LookupEdit can be populated from a BO via a BBS and so you would be doing all your searching in a familiar strataframe BO.
We don't use the ComboBoxEdit at all, we've found the LookupEdit far more flexible.
Peter
Public
For i As Integer = 0 To combo.Properties.Items.Count - 1 If combo.Items(i).Value = EditValue Then Return combo.Items(i).Display Next
And yes, Trent...On a scale of 1-10, 10 being the highest...you're right, you are 1.
Depends on the size of the cat