Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1315
UltraComboBox Datasource change
posted

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

Parents
  • 469350
    Offline posted

    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.

Reply Children