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

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

Corresponds to a Boolean value of true.

False

Corresponds to a Boolean value of false.

Default

The value is determined by the current object’s parent object setting (e.g., a control setting).

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