469,619 Members | 2,493 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,619 developers. It's quick & easy.

Dependency between two DataGridViewComboBoxColumn


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

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.



Apr 7 '06 #1
0 1028

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.