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

PropertyGridControl.CustomDrawRowBrick Event

Allows you to customize brick buttons that invoke a context menu (the Office view only).

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v18.2.dll

Declaration

public event CustomDrawRowBrickEventHandler CustomDrawRowBrick

Event Data

The CustomDrawRowBrick event's data class is DevExpress.XtraVerticalGrid.Events.CustomDrawRowBrickEventArgs.

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 CustomDrawRowBrick event allows you to customize the brick buttons.


private void propertyGridControl1_CustomDrawRowBrick(object sender, DevExpress.XtraVerticalGrid.Events.CustomDrawRowBrickEventArgs e) {
    e.Handled = true;
    Size size = new Size(7, 7);
    Rectangle bounds = RectangleHelper.GetCenterBounds(e.RowBrickInfo.BrickArea, size);
    if (e.RowBrickInfo.State == DevExpress.Utils.Drawing.ObjectState.Normal)
        e.Cache.FillRectangle(Color.Transparent, bounds);
    if (e.RowBrickInfo.State == DevExpress.Utils.Drawing.ObjectState.Hot)
        e.Cache.FillRectangle(Color.LightGray, bounds);
    e.Cache.DrawRectangle(bounds, Color.DarkGray, e.RowBrickInfo.BorderThickness);
}

To populate a context menu invoked with a click on a brick button, handle the PropertyGridControl.RowBrickMenuShowing event.

See Also