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
One other option is to use the UltraCombo instead. It has an AllowNull property that works as you'd hope in conjunction with limittolist, i.e. it restricts you to just the items in the list but the value can still be nulled. SuggestAppend works nicely and generally it all works well.
You can write a bit of code to format the list to only show one column in the drop down list and to remove column headings etc if so desired and then just stick that code in a static helper class somewhere and pass the layout of the combo to it in the initializeLayout event of the combo.
HTH
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.
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
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.