Skip to main content
A newer version of this page is available. .

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

NuGet Packages: DevExpress.Win.Design, 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
True

true. DefaultBoolean.True has a constant value of 0, while the standard true value corresponds to a value of 1. In Visual Basic, do not use implicit conversion of Boolean values to DefaultBoolean, and vice versa, as the conversion may produce incorrect results.

False

false. DefaultBoolean.False has a constant value of 1, while the standard false value corresponds to a value of 0. In Visual Basic, do not use implicit conversion of Boolean values to DefaultBoolean, and vice versa, as the conversion may produce incorrect results.

Default

The default behavior determined by the control’s logic.

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