Back to Devexpress

CardHitTest Enum

windowsforms-devexpress-dot-xtragrid-dot-views-dot-card-dot-viewinfo-45ad434d.md

latest9.1 KB
Original Source

CardHitTest Enum

Lists values identifying Card View’s visual elements.

Namespace : DevExpress.XtraGrid.Views.Card.ViewInfo

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
public enum CardHitTest
vb
Public Enum CardHitTest

Members

NameDescription
None

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

| | Card |

The test point belongs to a card‘s area not occupied by card constituent elements (in other words, the point belongs to a card’s edge).

| | CardCaption |

The test point belongs to a card’s caption.

| | CardExpandButton |

The test point belongs to the card expand button that resides within the card caption and is used to expand/collapse the card.

| | Field |

The test point belongs to a card field‘s area which is not occupied by the field caption or field value cell (in other words, the point belongs to a field edge).

| | FieldCaption |

The test point belongs to a field caption.

| | FieldValue |

The test point belongs to a field value cell.

| | Separator |

The test point belongs to a card separator.

| | CardUpButton |

The test point belongs to a top card scroll button.

| | CardDownButton |

The test point belongs to a bottom card scroll button.

| | CardCaptionErrorIcon |

The test point belongs to an error icon displayed within a card caption. Such error icons are displayed when cards fail to be validated.

| | QuickCustomizeButton |

The test point belongs to the customization button.

| | CloseZoomButton |

The test point belongs to a Card View’s zoom button.

| | FilterPanel |

The test point belongs to a filter panel.

| | FilterPanelCloseButton |

The test point belongs to a filter panel close button.

| | FilterPanelActiveButton |

The test point belongs to the check box in the filter panel used to enable/disable filtering within a Card View.

| | FilterPanelText |

The test point belongs to a string in the filter panel which represents the filter criteria applied to a Card View.

| | FilterPanelMRUButton |

The test point belongs to a button in the filter panel used to display a dropdown window with a list of the most recently used filter criteria.

| | FilterPanelCustomizeButton |

The test point belongs to the filter panel customize button.

| | ViewCaption |

The test point belongs to the View Caption.

| | MasterTabPageHeader |

The test point belongs to the View’s master-detail tab.

|

The following properties accept/return CardHitTest values:

Remarks

CardHitTest enumeration values are returned by the CardHitInfo.HitTest property of a CardHitInfo object. CardHitInfo objects can be created by calling the Card View’s CardView.CalcHitInfo method.

The following images illustrate some visual elements and corresponding enumeration values. For a complete list of enumeration values, see the table below.

Example

The following sample code shows how to identify the element located at a specific point using the GridView.CalcHitInfo method.

In the example, the CalcHitInfo method is called when you move the cursor over a Grid Control. The name of the current View element is displayed in the form’s caption.

csharp
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Base.ViewInfo;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
// ...
private void gridControl1_MouseMove(object sender, MouseEventArgs e) {
    GridControl grid = sender as GridControl;
    if (grid == null) return;
    // Get a View at the current point.
    BaseView view = grid.GetViewAt(e.Location);
    if (view == null) return;
    // Retrieve information on the current View element.
    BaseHitInfo baseHI = view.CalcHitInfo(e.Location);
    GridHitInfo gridHI = baseHI as GridHitInfo;
    if (gridHI != null)
        Text = gridHI.HitTest.ToString();
}
vb
Imports DevExpress.XtraGrid
Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraGrid.Views.Base.ViewInfo
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
' ...
Private Sub GridControl1_MouseMove(ByVal sender As System.Object, _
  ByVal e As System.Windows.Forms.MouseEventArgs) _
  Handles GridControl1.MouseMove
    Dim grid As GridControl = sender
    If grid Is Nothing Then
        Return
    End If
    ' Get a View at the current point.
    Dim view As BaseView = grid.GetViewAt(e.Location)
    If view Is Nothing Then
        Return
    End If
    ' Retrieve information on the current View element.
    Dim baseHI As BaseHitInfo = view.CalcHitInfo(e.Location)
    Dim gridHI As GridHitInfo = TryCast(baseHI, GridHitInfo)
    If Not gridHI Is Nothing Then
        Text = gridHI.HitTest.ToString()
    End If
End Sub

See Also

HitTest

CardHitInfo

CalcHitInfo

Hit Information

DevExpress.XtraGrid.Views.Card.ViewInfo Namespace