Hello All:
I have 2 dataGridViews and id like it that when I select a row in dgv_A that dgv_B clearsSelection.
I have aceived this using
dgv_A_SelectionChanged
{
dgv_B.ClearSelection();
}
and the same for dgv_B_SelectionChanged, except it obviously clears A.
This works fine except for one thing :
when I click in the dgv that has no row selcted, it clears the other dgv (as expected) but it also clears itself to (or rather the row I just clicked isnt selected), making me have to click again to select a row.
There is an overload for the clearSelection Method that allows you to pass in the column & row so that it is not cleared, i have tried the following with no success :-
public void dgv_A_SelectionChanged(object sender, EventArgs e)
{
dgv_A.ClearSelection(dgv_A.SelectedColumns[0].Index, dgv_A.SelectedRows[0].Index, false);
dgv_B.ClearSelection();
}
I get a nice syntax error from intellisense saying:-
ClearSelection(int, int, bool) is unavailable because of its protection level
Can some kind soul explain what im doing wrong.
Many thanks
Tino