PropertyGridControl.MenuOpening Event
Occurs when a user opens a property grid menu and allows you to customize this menu.
Namespace: DevExpress.Xpf.PropertyGrid
Assembly: DevExpress.Xpf.PropertyGrid.v24.2.dll
NuGet Package: DevExpress.Wpf.PropertyGrid
#Declaration
public event EventHandler<PropertyGridMenuEventArgs> MenuOpening
#Event Data
The MenuOpening event's data class is PropertyGridMenuEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Customizations | Gets a collection of menu customizations applied in this event handler. |
Handled |
Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.
Inherited from Routed |
Items | Gets items displayed in the invoked menu. |
Menu | Gets the invoked menu. |
Menu |
Gets the invoked menu’s type. |
Original |
Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class.
Inherited from Routed |
Routed |
Gets or sets the Routed |
Row |
Gets a property grid row.
Inherited from Property |
Source |
Gets the Property |
Target |
Gets the UI element for which the menu is shown. |
Value |
Gets a row’s value.
Inherited from Property |
The event data class exposes the following methods:
Method | Description |
---|---|
Invoke |
When overridden in a derived class, provides a way to invoke event handlers in a type-specific way, which can increase efficiency over the base implementation.
Inherited from Routed |
On |
When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes.
Inherited from Routed |
#Remarks
The following example adds tooltips to items displayed in the Issues collection’s new item menu:
<dxprg:PropertyGridControl x:Name="propertyGrid" ShowCategories="Hidden" MenuOpening="OnMenuOpening"/>
using DevExpress.Xpf.Core;
using DevExpress.Xpf.PropertyGrid;
// ...
private void OnMenuOpening(object sender, PropertyGridMenuEventArgs e) {
if (e.MenuType == PropertyGridMenuType.NewItem && e.Row.Path == "Issues") {
e.Items[0].ToolTip = "Create a new breaking change.";
e.Items[1].ToolTip = "Report a new bug.";
e.Items[2].ToolTip = "Ask a new question.";
}
}