System.Windows.Forms.DataGrid.HitTest Method

Gets information, such as row and column number of a clicked point on the grid, about the grid using a specific System.Drawing.Point.

Syntax

public DataGrid.HitTestInfo HitTest (System.Drawing.Point position)

Parameters

position
A System.Drawing.Point that represents single x,y coordinate.

Returns

A System.Windows.Forms.DataGrid.HitTestInfo that contains specific information about 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