M
Michaela Julia
Hi,
I'm trying to select/deselect a DataGridView row by simply clicking on it
private void datagridview1_MouseClick(object sender, MouseEventArgs e)
{
DataGridView.HitTestInfo info = datagridview1.HitTest(e.X, e.Y);
datagridview1.Rows[info.RowIndex].Selected=
!datagridview1.Rows[info.RowIndex].Selected;
}
Sadly, the standard behaviour for this control is to _always_ select a
row when the user clicks on it ... then "my" event fires and deselects it.
Well, it's almost what I wanted but only quite. 'Cause now I actually
can't _select_ any rows.
Any idea how to let my click event become the one and only?![Smile :-) :-)](/styles/default/custom/smilies/smile.gif)
tia
I'm trying to select/deselect a DataGridView row by simply clicking on it
private void datagridview1_MouseClick(object sender, MouseEventArgs e)
{
DataGridView.HitTestInfo info = datagridview1.HitTest(e.X, e.Y);
datagridview1.Rows[info.RowIndex].Selected=
!datagridview1.Rows[info.RowIndex].Selected;
}
Sadly, the standard behaviour for this control is to _always_ select a
row when the user clicks on it ... then "my" event fires and deselects it.
Well, it's almost what I wanted but only quite. 'Cause now I actually
can't _select_ any rows.
Any idea how to let my click event become the one and only?
![Smile :-) :-)](/styles/default/custom/smilies/smile.gif)
tia