Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
Search behaviour in WinCombo
posted

Hi there,

 I have got a question about the search behaviour in a Combobox. I have got a Combo Box which is filled from a DataSet. There is an ID and a Value. I set   cmb.ValueMember = "id" and cmb.DisplayMember = "value".  eg. id=UZ value=usbekistan (german spelling). If I get into the box and type UZ it completes to usbekistan which is what I expected and wanted to have. But now I have id=US and value=Vereinigte Staaten von Amerika. If I type US it completes to Usbekistan.

Is it possible to configure the Combobox that only the ids will be matched and not what I use as values?

 

Regards,

Anja 

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Anja,

        No, the Combo will always search the DisplayMember field first, and then look in the ValueMember field only if it did not find a match.

        You might want to consider creating your own custom combo control. This isn't as difficult as it might sound. What you do is create an UltraTextEditor control and add a DropDownEditorButton to the ButtonsRight collection. Then you can put a WinGrid on the form and assign it as the Control property of the DropDownEditorButton. You will have to handle some events to control what happens when the user selects a row in the grid and such, but this way you could completely control the searching behavior. 

Reply Children