DataGrid.HitTestInfo Class

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Contains information about a part of the System.Windows.Forms.DataGrid at a specified coordinate. This class cannot be inherited.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

System.Object
  System.Windows.Forms.DataGrid.HitTestInfo

[<Sealed>]
type HitTestInfo = class end

NameDescription
System_CAPS_pubpropertyColumn

Gets the number of the column the user has clicked.

System_CAPS_pubpropertyRow

Gets the number of the row the user has clicked.

System_CAPS_pubpropertyType

Gets the part of the System.Windows.Forms.DataGrid control, other than the row or column, that was clicked.

NameDescription
System_CAPS_pubmethodEquals(Object)

Indicates whether two objects are identical.(Overrides Object.Equals(Object).)

System_CAPS_pubmethodGetHashCode()

Gets the hash code for the DataGrid.HitTestInfo instance.(Overrides Object.GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Gets the type, row number, and column number.(Overrides Object.ToString().)

NameDescription
System_CAPS_pubfieldSystem_CAPS_staticNowhere

Indicates that a coordinate corresponds to part of the System.Windows.Forms.DataGrid control that is not functioning.

The DataGrid.HitTestInfo class, in conjunction with the HitTest method of the DataGrid control, is used to determine which part of a DataGrid control the user has clicked. The DataGrid.HitTestInfo class contains the row, column, and part of the grid that was clicked. See the DataGrid.HitTestType enumeration returned by the Type property for a complete list of grid parts.

To return a DataGrid.HitTestInfo, invoke the HitTest method from the MouseDown event of DataGrid control. Pass the x and y properties of the MouseEventArgs to the HitTest method.

The following example uses the HitTest method in a MouseDown event to return the DataGrid.HitTestInfo object. The row, column, and part of the grid are then printed.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: