System.Windows.Forms.DataGrid.HitTest Method

Gets information, such as row and column number of a clicked point on the grid, using the x and y coordinate passed to the method.

Syntax

public DataGrid.HitTestInfo HitTest (int x, int y)

Parameters

x
The horizontal position of the coordinate.
y
The vertical position of the coordinate.

Returns

A System.Windows.Forms.DataGrid.HitTestInfo that contains information about the clicked part of the grid.

Remarks

The System.Windows.Forms.DataGrid.HitTestInfo, in conjunction with the DataGrid.HitTest(int, int) method of the System.Windows.Forms.DataGrid control, is used to determine which part of a System.Windows.Forms.DataGrid control the user has clicked. The System.Windows.Forms.DataGrid.HitTestInfo contains the row, column, and part of the grid that was clicked. Additionally, the System.Windows.Forms.DataGrid.HitTestInfo.Type property returns a System.Windows.Forms.DataGrid.HitTestType enumeration.

The DataGrid.HitTest(int, int) method takes an x and y argument supplied by the System.Windows.Forms.DataGrid control's Control.DragDrop, Control.DragEnter, Control.DragOver, Control.MouseDown, Control.MouseMove, Control.MouseUp and Control.MouseWheel events.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0