Hello,
I'm using UltraComboEditor with DropDownStyle - DropDown and AutoCompleteMode - Suggest.
It searches fine, but user can type any text, even if it is not in the combobox items. How can I limit user with combobox items? DropDownStyle DropDownList is not an option because search text cannot be seen.
You could try setting the LimitToList to True of your UltraComboEditor control like:
ultraComboEditor1.LimitToList = true;
Please let me know if you have any other questions with this matter.
Thanks, it works, but half. It allows you to enter any text, so in this case I need to catch an event when user is trying to leave incorrect text in combobox, and control doesn't let him do anything else. To tell user that data is incorrect. Otherwise it's impossible to understand for user why he can't do anything on the form.
Or is there any way to forbid to enter incoorect text? (that isn't in the combobox items).
One thing that you could do is using the IsItemInList method of the UltraComboEditor control and verify is there is such item prior leaving the control like:
private void ultraComboEditor1_Leave(object sender, EventArgs e) { if (!ultraComboEditor1.IsItemInList(ultraComboEditor1.Text)) { MessageBox.Show("There is not item matching the text you entered"); } }
Please feel free to let me know if this is not what you are looking for.
"Leave" does not shoot when parent panel or form is clicked. But I will think up something.
Thanks.
The "Leave" event is not supposed to fie on the conditions that you said. You always could verify yourself if the condition is met or not like:
private void Form1_Click(object sender, EventArgs e) { if (ultraComboEditor1.IsInEditMode) { if (!ultraComboEditor1.IsItemInList(ultraComboEditor1.Text)) { MessageBox.Show("There is not item matching the text you entered"); } } }
You also could use IsItemInList method wherever you would like to verify if the entered text in the control is an actual item or not.
Please feel free to let me know if there is anything else that I could provide you further.
If you need any further assistance please do not hesitate to contact us.