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
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.
Hi Mike
I probably didn't explain it well.
Image the combo's list is the Username field on the Employee table but I bind the combo to the Order.Operator field.
After an employee 'John Doe' leaves, his Employee record is deleted but some old Order records would still have 'John Doe' as their operator. When the combo comes across one of these, 'John Doe' isn't in its list so it shows no value.
To follow your suggestion, I'd have to populate the combo's value list by searching all Order records instead of the Employee table which has much fewer records.