GridView.CustomDrawGroupRowCell Event

Allows you to manually paint individual cells of group rows.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v21.1.dll


public event RowGroupRowCellEventHandler CustomDrawGroupRowCell

Event Data

The CustomDrawGroupRowCell event's data class is DevExpress.XtraGrid.Views.Base.RowGroupRowCellEventArgs.


The code below displays group summaries for the “Length” and “Mark” columns in group rows, and applies a custom color to these group rows’ cells.

GridControl - CustomDrawGroupRowCells

gridView.OptionsBehavior.AlignGroupSummaryInGroupRow = DefaultBoolean.True;
    // group summaries
    GridGroupSummaryItem item = new GridGroupSummaryItem() {
        FieldName = "Length",
        SummaryType = SummaryItemType.Sum,
        ShowInGroupColumnFooter = gridView.Columns["Length"]

    item = new GridGroupSummaryItem() {
        FieldName = "Mark",
        SummaryType = SummaryItemType.Count,
        ShowInGroupColumnFooter = gridView.Columns["Mark"]

    // Handle this event to paint group row cells manually
    gridView.CustomDrawGroupRowCell += (s, e) => {
        e.Appearance.BackColor = Color.BlanchedAlmond;
        e.Appearance.FillRectangle(e.Cache, e.Bounds);
        e.Appearance.ForeColor = Color.DimGray;
        e.Appearance.DrawString(e.Cache, e.DisplayText, e.CaptionBounds);
        e.Handled = true;
See Also