Hello,
This method would be use in a Click Event. It gives information about the
System.Windows.Forms.DataGrid control at a specified point on the screen. e
is the point you have clicked. DataGridHitTest give you the the Clicked
Cell.
Example:
private void dataGrid1_MouseUp(System.Windows.Forms.MouseEventA rgs e)
{
DataGrid.HitTestInfo hti = this.HitTest(new Point(e.X, e.Y));
switch(hti.Type)
{
case DataGrid.HitTestType.RowHeader:
//RowHeader was clicked
break;
case DataGrid.HitTestType.ColumnHeader:
//ColumnHeader was clicked
break;
case DataGrid.HitTestType.Cell:
//a Cell was clicked
break;
}
}
http://msdn2.microsoft.com/en-us/lib...d.hittest.aspx