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
91
UltraComboEditor acccepting Ids as valid entries
posted

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!

 

Parents
  • 69832
    Suggested Answer
    Offline posted

    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'.

Reply Children
No Data