What is the best way to manage a parent/child relationship between two comboboxes on a form? Both comboboxes have collections as their datasources. When a selection is made in the parent combobox, I would like the child combobox item list to be limited to those items related to the item selected in the parent.
I have tried the following, but the child combobox is never populated:
Code:
private void cboManufacturer_SelectedIndexChanged(object sender, EventArgs e)
{
if (cboManufacturer.SelectedIndex != -1)
{
vwAircraftModelGroupsCollection.Query.Where
(
vwAircraftModelGroupsCollection.Query.MftShortMake.Equal(cboManufacturer.SelectedValue)
);
vwAircraftModelGroupsCollection.Query.Load();
cboAircraftGroup.Refresh();
}
}
The vwAircraftModelGroupsCollection (child) isn't loaded in this approach until an item is selected in the parent combobox (cboManufacturer). Is there a better way to do this?