I am using an UltraComboEditor
The UltraComboEditor is linked to a List<> where the DisplayMember is set to "Description" and the ValueMember is Set to "ID"
the ID is an integer and is stored in the relevant field on the table.
the UltraComboEditor is Styled as a DropDown, Autocompletemode = Suggest, AutosuggestFilterMode = Contains, Limit to List = true.
my problem is that when my form is initialised to edit a new record, where the value for the combo box has not yet been set the text of the combobox has defaulted to "0"
This is a pain as and "0" is not in the List and when the user starts to type, they have to delete the "0"
As a work around I set the UltraComboEditor.Text = "" where UltraComboEditor.Text = "0" in the Value_Changed Event, (though this will not work if an entry in the list begins with "0"!)
How can I get the UltraComboEditor to initialise to "" (string.empty) instead of "0"?
This situation has occurred because the properties we are setting are integer foreign keys. The new entity is created and the FK's are initialised to 0.
If they are set to nullable they get initialised to null which means the combobox starts up empty, but then were sacrificing data integrity in sql for the sake of the interface.
But it is always better to have choice about the way things work.
Thanks Mike
Okay, I understand what you are saying about the AutoSuggest. So using DropDownList is not a viable solution in this case.
Just to elaborate a little further, the intention of LimitToList is to limit the user. It prevents the user from choosing an item that is not on the list.
It was never intended to prevent you from assigning a value to the control in code. Which is not to say that it shouldn't do this, but that was not the intention when the property was added. When we added this property, the design assumed that the programmer knows that the values are limited to what's on the list and would never explicitly set the value of the control to an invalid value - which is essentially what's happening here.
Hello Larry,
For your convenience, I have sent your feature request directly to our product management team. Our product team chooses new feature requests for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested features, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your feature is chosen for development, you will be notified at that time. Your reference number for this feature request is FR13968.
If you would like to follow up on your feature request at a later point, you may contact Developer Support management via email. Please include the reference number of your feature request in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
Thank you for your request.
Hello again,
Teleriks equivalent defaults to the first entry in the list, which makes a bit more sense, but I guess having options to cope with different circumstance is the reason we buy in control librarys over standard windows.
If you switch to DropDownList, you loose the SuggestAppend functionality as you can no longer type in the textbox. We are using the Suggest Append funtionality of the comboeditor, the list of items can be very long and the Suggest Append rapidly reduces the selection time, otherwise selection works like a standard combobox.
Whats wrong with populating the Text Box with a text version of the index is that the combo editor Text Box is initialised with an illegal value (due to the LimitToList option), as far as the user is concerned a non-sensical value and its also an obstructor, as the value needs to be deleted adding additional keypresses to a potentially repetative task. You would not be surprised at how irked an end user can get !
Obviously you can work around by trapping the situation in code behind, but that clutters and adds cut and paste code which then adds to the maintenance required.
I think I'm waffling now, I'll go submit that feature request
Hi,
runningiggles said:No other third party controls or even .net behave this way.
I just tried this out with the ComboBox control in DotNet. It doesn't have a LimitToList property, so there's no way to really compare the two.
The closest thing the inbox ComboBox has to LimitToList is the DropDownStyle property. If you set it to DropDownList, I see that the ComboBox does not display any value - it shows blank.
So I tried the same thing with UltraComboEditor and I get the same results - UltraComboEditor displays blank.
So perhaps the solution here is to set DropDownStyle to DropDownList rather than using LimitToList.
Here's a link to Submit a feature request to Infragistics.