Skip to main content

PGridOptionsView.ShowRowBrick Property

Gets or sets whether to display brick buttons against properties that invoke a context menu (the Office view only).

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v24.1.dll

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

Declaration

[DefaultValue(DefaultBoolean.Default)]
[XtraSerializableProperty]
public DefaultBoolean ShowRowBrick { get; set; }

Property Value

Type Default Description
DefaultBoolean Default

True to display brick buttons; otherwise, Default or False.

Available values:

Name Description Return Value
True

The value is true.

0

False

The value is false.

1

Default

The value is specified by a global option or a higher-level object.

2

Property Paths

You can access this nested property as listed below:

Object Type Path to ShowRowBrick
PropertyGridControl
.OptionsView .ShowRowBrick

Remarks

The property grid can display a context menu for a particular property. The menu contains the predefined Reset command that sets the property to its default value. You can provide custom commands by handling dedicated events. To invoke the menu, users can do one of the following:

  • click a brick button displayed against a property. Brick buttons are only available in the Office view (see PropertyGridControl.ActiveViewType). To show brick buttons, set ShowRowBrick property to True. To populate the menu, handle the PropertyGridControl.RowBrickMenuShowing event;

    PropertyGrid_Bricks

    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;
        }
    }
    private void Grid_RowBrickMenuShowing(object sender, Events.PopupMenuShowingEventArgs e) {
        if(e.Row.Properties.FieldName == "Appearance.BackColor")
            e.Menu.Items.Add(CreateDataBindingItem);
    }
    

    Note

    Items added using this event are not shown when the menu is invoked with a right-click on a property (see below).

    You can also customize brick buttons by handling the PropertyGridControl.CustomDrawRowBrick event.

  • right-click a property. To enable the menu, use the VGridOptionsMenu.EnableContextMenu property. To populate the menu, handle the VGridControlBase.PopupMenuShowing event;

    PropertyGrid_ContextMenu

    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;
        }
    }
    private void Grid_PopupMenuShowing(object sender, Events.PopupMenuShowingEventArgs e) {
        if(e.Row.Properties.FieldName == "Appearance.BackColor")
            e.Menu.Items.Add(CreateDataBindingItem);
    }
    

    Note

    Items added using this event are also shown when the menu is invoked with a click on a brick button displayed against a property.

See Also