PropertyGridControl.RowBrickMenuShowing Event
Allows you to populate a context menu invoked with a click on a brick button (the Office view only).
Namespace: DevExpress.XtraVerticalGrid
Assembly: DevExpress.XtraVerticalGrid.v22.2.dll
NuGet Package: DevExpress.Win.VerticalGrid
Declaration
Event Data
The RowBrickMenuShowing event's data class is PopupMenuShowingEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Menu | Gets or sets the control’s popup menu that will be shown. |
RecordIndex | |
RecordObject | |
Row | Gets the row where the popup menu will be displayed. |
Remarks
In the Office view (see PropertyGridControl.ActiveViewType), you can display brick buttons against properties by setting the PropertyGridControl.OptionsView.ShowRowBrick property to True (see PGridOptionsView.ShowRowBrick).
The RowBrickMenuShowing event allows you to populate the menu.
using DevExpress.Utils.Menu;
propertyGridControl1.RowBrickMenuShowing += propertyGridControl1_RowBrickMenuShowing;
private void propertyGridControl1_RowBrickMenuShowing(object sender, DevExpress.XtraVerticalGrid.Events.PopupMenuShowingEventArgs e) {
if (e.Row.Properties.FieldName == "Appearance.BackColor")
e.Menu.Items.Add(CreateDataBindingItem);
}
DXMenuItem createDataBindingItem;
protected DXMenuItem CreateDataBindingItem {
get {
if (createDataBindingItem == null) {
DXMenuItem item = new DXMenuItem("Create Data Binding...");
item.Click += (s, ee) => MessageBox.Show("'Create Data Binding...' is clicked.");
createDataBindingItem = item;
}
return createDataBindingItem;
}
}
Note
Items added using this event are not shown when the menu is invoked with a right-click on a property (see PGridOptionsView.ShowRowBrick).
You can also customize the brick buttons by handling the PropertyGridControl.CustomDrawRowBrick event.