Hello
How can I set the control, so that:
1) It auto-completes.2) The completion is limited to the listed items.3) If nothing is selected, the control can lose focus.
Thanks a lot.
Try something like this:
private void Form1_Load(object sender, EventArgs e) { this.ultraComboEditor1.AutoComplete = true; this.ultraComboEditor1.LimitToList = true; } private void ultraComboEditor1_ItemNotInList(object sender, Infragistics.Win.UltraWinEditors.ValidationErrorEventArgs e) { if (e.InvalidText == null || e.InvalidText.Length == 0) { e.RetainFocus = false; } }
Mike,
This ItemNotInList event code works fine when placed in a form containing the ComboEditor, but when I place the event handler in a sub-classed ComboEditor class (ie MyComboEditor), it doesn't behave properly.
The event triggers ok and RetainFocus successfully sets to false, but the control still doesn't release focus afterwards. It only seems to behave when you click in and out of the control without typing or selecting anything.
I'm wanting to use this behaviour on all my Combos, so any ideas on why it doesn't work in a sub-classed control?
Thanks for your previous reply.
At this point, the user can type into the text part of the combo and the most similar item of the list is autoselected (autocomplete is on). However, I would like to filter the keystrokes in order to prevent and invalid text -as a consequence, it would prevent the NotInList() event from raising. How can I do that?