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"?
Hello,
I will be happy to assist you with this issue.
I followed the steps you suggested and was unable to reproduce the behavior you're describing.
I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using. My test was performed using version 11.2.20112.2019 in NetAdvantage for .NET 2011 Volume 2.
If the project does show the product feature working correctly, this indicates a possible problem in the code of your application. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.
Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.
Please let me know if I can provide any further assistance.
Please let me know if I may be of any further assistance regarding the sample I created to help reproduce this issue. I will follow up with you again in other three days if I don't receive a response.
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
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.
I have started on a short term solution to the 0 problem
I have added an inherited UltraComboEditor to the project (udUltraComboBox)
I have hooked up the InitialiseDataItem event to reset the text. I selected this event as it is the only one (I found) that fires after the initial value is set, but not called constantly during the controls lifetime.
There probably is a better event/way to do this, isnt there.... ?
I read in this posts that you have a ultracomboEditor that allows your user to insert and delete a value.
I need to know how to let my users delete a value on my ultracomboEditor.
Can you please teel me how do you did that?
Thankyou!!!!
Most of my combo editors are linked to a lookup table in my database, so adding and removing entries from the selection are done by editing the lookup lists.
You can add entries to the list bycreating a new ValueListItem and adding it to the Items collection.
you can remove items from the list by using Items.Remove and Items.RemoveAt methods.
Im not sure why you would want to give a user the ability to remove an item from the list at selection time as surely its the value you are selecting that is important, not what you dont want in the list.
But you could probably catch the Delete key press event and then remove the selected item?
I don't want to give my users the ability to remove items from the valueItemsList.
I want to give them the possibility to type a value and the dorpdownList shows them all the possibilities to select. This works fine but then, I want to give them the possibility to edit the typed value.
For example, my user typed the value 300 but then he want to type "30". I want to know how to set the dropdownlist to the new values..