Hi
I have a UltraComboBox [B] in my application, for which, datasource is assigned as per the value of other UltraComboBox [A].
Now if I change value of ComboBox [A], Datasource of ComboBox [B] is changed without error, but if I select some value from dropdown for ComboBox [B] and then change Value of ComboBox [A] application crashes.
The error I receive when assigning new datasource is:
Can not find Column "OldColumnName"
Thanks
Shivangi
Hi Shivangi,
If you change the DataSource on UltraCombo [B], then some of the properties of [B] are no longer valid. For example, the ValueMember and DisplayMember properties. These properties point to columns in the Combo and those columns might not exist in the new data source. So I recommend that you clear these properties (set the to null) before you change the DataSource and see if that helps.
Also, the Value property of the combo is probably not valid, either, since it refers to a value in the old DataSource, So it probably wouldn't hurt to set the Value to null, also.
Finally, when you are setting the DataSource on the combo, it's a good idea to use the SetDataBinding method, instead of the DataSource and DataMember properties.
Hi Mike,
Thanks you for the response,
It does solve the error if I set ValueMember, DisplayMember and Value property to NULL.
I earlier tried to reset combobox by setting Datasource as NULL and combobox.refresh, But it was still giving me error.
Shouldn't it refresh all properties if I use datasource as Null and refresh view?