Back to Devexpress

PopupMenuShowingEventArgs.TargetElement Property

wpf-devexpress-dot-xpf-dot-pivotgrid-dot-popupmenushowingeventargs-7e2014e4.md

latest3.0 KB
Original Source

PopupMenuShowingEventArgs.TargetElement Property

Gets the UI element for which the context menu is shown.

Namespace : DevExpress.Xpf.PivotGrid

Assembly : DevExpress.Xpf.PivotGrid.v25.2.dll

NuGet Package : DevExpress.Wpf.PivotGrid

Declaration

csharp
public IInputElement TargetElement { get; }
vb
Public ReadOnly Property TargetElement As IInputElement

Property Value

TypeDescription
IInputElement

The element displayed within a pivot grid for which the context menu is shown.

|

Remarks

To learn more, see Context Menus.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the TargetElement 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.

wpf-pivot-grid-show-top-n-values-in-context-menu/CS/ContextMenuToShowTopN_Example/MainWindow.xaml.cs#L48

csharp
{
    FieldValueElement fvElement = e.TargetElement as FieldValueElement;
    if (fvElement == null) return;

wpf-pivot-grid-show-top-n-values-in-context-menu/VB/ContextMenuToShowTopN_Example/MainWindow.xaml.vb#L44

vb
Private Sub pivotGridControl1_PopupMenuShowing(ByVal sender As Object, ByVal e As PopupMenuShowingEventArgs)
    Dim fvElement As FieldValueElement = TryCast(e.TargetElement, FieldValueElement)
    If fvElement Is Nothing Then

See Also

MenuType

Context Menus

PopupMenuShowingEventArgs Class

PopupMenuShowingEventArgs Members

DevExpress.Xpf.PivotGrid Namespace