dashboard-devexpress-dot-dashboardwin-dot-dashboarddesigner-d086126d.md
Allows you to customize a data item popup menu invoked in the UI.
Namespace : DevExpress.DashboardWin
Assembly : DevExpress.Dashboard.v25.2.Win.dll
NuGet Package : DevExpress.Win.Dashboard
public event DataItemPopupMenuShowingEventHandler DataItemPopupMenuShowing
Public Event DataItemPopupMenuShowing As DataItemPopupMenuShowingEventHandler
The DataItemPopupMenuShowing event's data class is DataItemPopupMenuShowingEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Allow | Gets or sets whether users can invoke a data item’s pop-up menu. |
| DashboardItemName | Gets the component name of the dashboard item for which the event is raised. |
| DataItem | Gets a data item for which a pop-up menu is invoked. |
| Menu | Gets a data item’s pop-up menu. |
The following code snippet shows how to hide the Day group interval option in pop-up menus of data items in the Arguments section:
using System.Linq;
using System.Windows.Forms;
using DevExpress.DashboardCommon;
using DevExpress.XtraBars;
// ...
private void dashboardDesigner1_DataItemPopupMenuShowing(object sender, DevExpress.DashboardWin.DataItemPopupMenuShowingEventArgs e){
CustomDashboardItem<FunnelItemMetadata> dashboardItem = dashboardDesigner1.Dashboard.Items[e.DashboardItemName] as CustomDashboardItem<FunnelItemMetadata>;
if(dashboardItem != null){
Dimension dimension = e.DataItem as Dimension;
if (dashboardItem.Metadata.Arguments.Contains(dimension)){
foreach (BarItemLink link in e.Menu.ItemLinks.Where(x => x.Data is DateTimeGroupInterval))
link.Visible = ((DateTimeGroupInterval)link.Data) != DateTimeGroupInterval.Day;
}
}
}
Imports System.Linq
Imports System.Windows.Forms
Imports DevExpress.DashboardCommon
Imports DevExpress.XtraBars
' ...
Private Sub dashboardDesigner1_DataItemPopupMenuShowing(ByVal sender As Object, ByVal e As DevExpress.DashboardWin.DataItemPopupMenuShowingEventArgs)
Dim dashboardItem As CustomDashboardItem(Of FunnelItemMetadata) = TryCast(dashboardDesigner1.Dashboard.Items(e.DashboardItemName), CustomDashboardItem(Of FunnelItemMetadata))
If dashboardItem IsNot Nothing Then
Dim dimension As Dimension = TryCast(e.DataItem, Dimension)
If dashboardItem.Metadata.Arguments.Contains(dimension) Then
For Each link As BarItemLink In e.Menu.ItemLinks.Where(Function(x) TypeOf x.Data Is DateTimeGroupInterval)
link.Visible = (CType(link.Data, DateTimeGroupInterval)) IsNot DateTimeGroupInterval.Day
Next link
End If
End If
End Sub
See Also