Hi,
I, like many others on this forum, have came to realize the lack of functionality in the UltraComboEditor for providing a means of selecing a Null (Value = null) when using a bounded control with the DropDownStyle set to DropDownList. I guess a simple solution would be to have the control automatically add a dummy item to the list that sets the Value property to null when the control is Nullable and DropDownList style is selected. The null item would appear as the first item in the list, would get its Text value from the NullText property that is already present and would not be included in the Items count or when retrieving the bounds item from the DataSource property.
I have submitted a feature request already and before trying to create some solution I and was wondering if anyone here has already created some kind of solution that myself and others could benefit from.
Thanks
If the Combo is bound, then the only way to get a "null" item onto the list would be to add one to the data source.
What about using an EditorButton? You could add a button the ButtonsRight or ButtonsLeft collection and then when the button is clicked, set the Value of the control to Null or DBNull.Value.
Oh... another idea would be to use the Del key. You could handle KeyUp and when the user presses Del or BackSpace you could set the control's Value to null.
An editor button will work, but its not the design that I am looking for. In regards to a bound Combo, it would require that the null item logic is handled on a lower level than the DataSource. The Combo breaks down to a item list where each item has a text and value field regardless of what the bound object structure is. So when the control generates the item list it would check the Nullable and DropDownStyle properites and add a null item if required. Selecting the null item would raise the SelectedIndexChanged/ChangeCommitted events and set the Value to null.
This is certainly possible, but it's not implemented right now. You should Submit a feature request to Infragistics
EDIT: Oops. Ignore that last part, you said you already did that.
Since this was a feature request over 4 years ago, does anyone know if it's been implemented yet? If so, how do use the new feature? I'd like to be able to have a drop down list limiting what a user can select to only the items available in the bound data but still allowing them to set the value of the control to NULL, e.g. by having a "blank" entry at the top.
Hello,
If I am getting your requirements right, you could set the 'LimitToList' to 'true', the 'Nullable' to 'true' and add an item with value Null, like this:
ultraComboEditor1.LimitToList = true; ultraComboEditor1.DropDownStyle = Infragistics.Win.DropDownStyle.DropDownList; ultraComboEditor1.Nullable = true; ultraComboEditor1.Items.Add(null, "");
Please let me know if you feel that I misunderstood you.