Hi everyone,
Straight to the point:
I am binding dictionaries to my UltraComboEditor iterating through my dictionary elements and adding them to the Items in my UltraComboEditor.
Quick example below:
this.ultraComboEditor1.Items.Add(1, "Value 1"); this.ultraComboEditor1.Items.Add(2, "Value 2"); this.ultraComboEditor1.Items.Add(3, "Value 3");
Now, the user can type any Id (1, 2, 3) and the UltraComboBox will replace it with the value. It is a very weird behavior and I can't explain that to my users (they think it is based in item position and not Id, so when I have a guid, or any other type as Id it would never work).
Is there any way to prevent this behavior in the control? If the user enters 1, I don't want the control to replace the Id with the value, I want it to be an invalid value.
Maybe I am doing something really wrong and I don't know it.
Please, any feedback will be greatly appreciated.
Thanks a lot!
When the DropDownStyle property is set to 'DropDown', the user can type in the edit portion, and in the case where what they type does not match an item's DisplayText, the string they typed is assigned to the control's Value property. In your case the value "1" is being assigned (not the integer value 1).
If you want to prevent the user from typing in the edit portion, you can set the DropDownStyle property to 'DropDownList'.
Hi,
That would be a possibility, but since I use the AutoComplete feature I want the user to be able to type in the control and have the Suggest Append functionality.
I found a way around to solve my problem, using the BeforeExitMode event. I can check for Selected Item (if any) DisplayText to match the Combo Box Text; and if it doesn't I have an invalid selection... It seems to be working fine, but I still have to give it some more testing.
I hope it helps some other guys in need.
Thanks team!