Hi Randy,
Thanks for your feedback.
Oh, I think the problem should be the time you invoke UnSelect and set
CurrentCell property.
If you change the selected row or selected cell in MouseDown event, the
mouse will reselect you clicked row or cell. So it appears that your code
has no effect.
I think you should add your code in MouseUp event, do like this:
private void dataGrid1_MouseUp(object sender,
System.Windows.Forms.MouseEventArgs e)
{
dataGrid1.CurrentCell= new DataGridCell(0,0); //set the selected cell to
first cell
}
or
private void dataGrid1_MouseUp(object sender,
System.Windows.Forms.MouseEventArgs e)
{
dataGrid1.UnSelect(dataGrid1.CurrentRowIndex);
}
If you still have anything unclear, please feel free to tell me.
Btw: Have good year beginning!
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.