Back to Devexpress

PivotGridHitInfo.HitTest Property

windowsforms-devexpress-dot-xtrapivotgrid-dot-pivotgridhitinfo-f339de4f.md

latest4.5 KB
Original Source

PivotGridHitInfo.HitTest Property

Gets a value identifying the type of the visual element located under the test point.

Namespace : DevExpress.XtraPivotGrid

Assembly : DevExpress.XtraPivotGrid.v25.2.dll

NuGet Package : DevExpress.Win.PivotGrid

Declaration

csharp
public PivotGridHitTest HitTest { get; }
vb
Public ReadOnly Property HitTest As PivotGridHitTest

Property Value

TypeDescription
PivotGridHitTest

A PivotGridHitTest enumeration value which identifies the type of the visual element that contains the test point.

|

Available values:

NameDescription
None

The test point does not belong to any visual element or is outside the PivotGridControl.

| | HeadersArea |

The test point belongs to the header area.

| | Cell |

The test point belongs to a cell.

| | Value |

The test point belongs to a field value.

| | FixedLeftDiv |

The test point belongs to the left fixed line.

| | FixedRightDiv |

The test point belongs to the right fixed line.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the HitTest property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-pivot-grid-draw-a-custom-element-on-mouse-hover/CS/WindowsApplication73/Form1.cs#L62

csharp
PivotGridHitInfo info = pivotGridControl1.CalcHitInfo(e.Location);
if (info.HitTest == PivotGridHitTest.Value)
{

pivot-grid-winforms-provide-custom-date-time-group-intervals-and-preserve-correct-sort-order/CS/WindowsApplication21/Form1.cs#L62

csharp
PivotGridHitInfo hitInfo = pivotGridControl1.CalcHitInfo(e.Location);
if (hitInfo.HitTest == PivotGridHitTest.Value && hitInfo.ValueInfo != null)
    dataGridView1.DataSource = hitInfo.ValueInfo.CreateDrillDownDataSource();

winforms-pivot-grid-draw-a-custom-element-on-mouse-hover/VB/WindowsApplication73/Form1.vb#L60

vb
Dim info As PivotGridHitInfo = pivotGridControl1.CalcHitInfo(e.Location)
If info.HitTest = PivotGridHitTest.Value Then
    mousePos = e.Location

pivot-grid-winforms-provide-custom-date-time-group-intervals-and-preserve-correct-sort-order/VB/WindowsApplication21/Form1.vb#L70

vb
Dim hitInfo As PivotGridHitInfo = pivotGridControl1.CalcHitInfo(e.Location)
    If hitInfo.HitTest = PivotGridHitTest.Value AndAlso hitInfo.ValueInfo IsNot Nothing Then dataGridView1.DataSource = hitInfo.ValueInfo.CreateDrillDownDataSource()
End Sub

See Also

PivotGridHitInfo Class

PivotGridHitInfo Members

DevExpress.XtraPivotGrid Namespace