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
195
Finding the first match in an Ultra Combo.
posted

I have created an account number combo that the displaymember records are in the format like:

XX-XXXX-XXX-XX 

I have  masked text box where a user can enter in an account match this is in the format of:

??-????-???-??

If the user enters a value in the match of ??-????-300-?? then on the leave event I would like the Account Number combo to select the first record that matches this text where the "?"'s are a wild card for 1 character.

if my combo were populated with records starting from 00-0000-000-00 to 99-9999-999-99 then the first record returned would be 000-0000-300-00.

I still want all the rows visible just select the first match.

Need a clue on where to start or an example.

 

Thanks Dan

 

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi Dan,

    I'm not really sure I follow you. It sounds like you are trying to mix two sets of features here - a dropdown list and a mask. There's no easy way to do that. The UltraCombo doesn't have any masking functionality.

    I guess if you are expecting the user to enter actual question marks, then you could certainly handle the Leave event of the Combo and loop through the list to find a matching item. Personally, I would probably use the Validating event, instead, since this fires before the focus is actually lost from the control and you can force the control to retain focus if you want.

    So I would handle the Validating event, then loop through the rows (this.ultraCombo1.Rows) collection and examine the cells in the appropriate column. You would have to write code to match your question mark characters. Perhaps you could use the RegEx class for that.

Children
No Data