Skip to main content

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.v23.2.dll

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

Declaration

public event PopupMenuShowingEventHandler RowBrickMenuShowing

Event Data

The RowBrickMenuShowing event's data class is PopupMenuShowingEventArgs. The following properties provide information specific to this event:

Property Description
HitInfoType Identifies a grid element located under the popup menu.
InRecordHeader Gets whether the menu is displayed within a record header.
InRow Gets whether the menu is displayed within a row.
Menu Gets or sets the control’s popup menu that will be shown.
RecordIndex Gets the index of a record where the popup menu will be displayed.
RecordObject Gets a data object that corresponds to a row where the popup menu will be displayed.
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).

PropertyGrid_Bricks

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.

See Also