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.
Hi ,
I'm having one proble using ultracomboeditor.
i 'll give sample code,
ultracomboeditor1.DataSource =datatable;ultracomboeditor1.ValueMember = "PK";ultracomboeditor1.DisplayMember = "FullName";
now i'm selecting one value from that ultracomboeditor1
string Result=ultracomboeditor1.selectedItem;
now the result variable value is like 'Sutha'.
ValueMember is 1
DisplayMember is Sutha
Instead of Sutha, i need to replace a string like Raghavan for same ValueMember 1.
After Replacing the string as raghavan, If i select raghavan should come for valuemember 1.
The old value 'Sutha' should not come. PLz help me
Plz anyone help me. Its urgent
I'm having trouble understanding your question. So you are setting the Text property on the ultraComboEditor to "Sutha" and the Value property returns 1 and that is correct.
Then you are changing the Text to "raghavan". Is that correct?And you are saying that the Value property is not returning the correct value from the ValueMember column?
How are you changing the text? Are you setting the Text property in code, or are you typing into the control?
In what event are you checking the Value? My guess is that you are just checking the Value too early, before the control has updated the Value property.
There's a "ListObject" property on UltraComboEditor you could use which you can cast into the underlying value from your data source. I've only ever used object data sources, not data tables, but i'd guess it would contain the data row from your data table. If you cast it into a data row, you could get whatever column values you need.