Hi,
I'm doing a DataGridView with two ComboBox columns. In the first
ComboBox I've all the sates of a country and in the second I've the
counties of each state.
I need to create a dependency between the two ComboBox, in such a way
that in the second ComboBox just appear the counties that belong to the
state selected in the first ComboBox.
To accomplish the task I've been created a TableAdapter which
contains all the counties and a DataView to filter this TableAdapter.
In this way everything work, but when I change the "state" (in the
first ComboBox) to a different value when I move the mouse over the
second ComboBox in a row that has a county that belong to another state
I get the following exception
"System.ArgumentException: DataGridViewComboBoxCell value is not
valid."
I know that the problem arises because the DataView is filtered to some
"state" different than the state that the county belongs to.
Does anybody know how can I fix it?
Maybe there's another way to accomplish the task. I just need to
resolve this.
Thanks,
Robe.