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
635
How to bind to table whose value isn't in an Ultracombo's ValueList
posted

Hi

I'm using an Ultracombo and binding it to a table's field like Order.DestinationCountry and the Datasource is another table Country so I can show two columns for the country's Code and Name. That works fine.

But if the DestinationCountry has been deleted from the Country table then the bound value doesn't show in the ultracombo.

I can't go through all Order records to find valid and invalid destination countries, that's not efficient. Plus I want only valid Country values in the Datasource so users can't select an invalid Country.

I'm thinking I have to bind an UltraTextEditor to Order.DestinationCountry then switch to the UltraCombo so users can select only valid a country.

Or is there another solution?

Thanks

John

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi John,

    I don't see how this could possibly work. In a typical application, you would hide or disable invalid choices. If you remove the options from your database, then any old records pointing to that field will no longer be able to access the data - since it isn't there. So that doesn't really make sense.

    What I would do is simply use the InitializeRow event of the combo to hide the rows on the list that are not valid. The Combo will still be able to find these items in order to match up the controls Value and show the correct display text. But the item will not appear on the list and so the user will not be able to select that item int the future.

Children