Back to Devexpress

TcxGridRowLayoutCustomDrawEvent Type

vcl-cxgridtableview-1c4537e0.md

latest2.5 KB
Original Source

TcxGridRowLayoutCustomDrawEvent Type

The custom draw procedural type for a row layout.

Declaration

delphi
TcxGridRowLayoutCustomDrawEvent = procedure(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridCellViewInfo; var ADone: Boolean) of object;

Parameters

NameTypeDescription
SenderTcxGridTableView

The grid Table View that raised the event.

| | ACanvas | TcxCanvas |

The target Table View’s canvas.

| | AViewInfo | TcxCustomGridCellViewInfo |

Contains the target row’s ViewInfo information.

| | ADone | Boolean |

Assign True to this parameter if you override the built-in draw routine. Do not change the parameter value if you only need to complement the built-in draw routine with custom draw operations.

|

Remarks

The following OnCustomDrawRowHotTrack event handler changes the default background color of selected rows to green:

delphi
procedure TForm1.cxGrid1TableView1RowLayoutCustomDrawRowSelection(
  Sender: TcxGridTableView; ACanvas: TcxCanvas;
  AViewInfo: TcxCustomGridCellViewInfo; var ADone: Boolean);
begin
  ACanvas.Brush.Color := clMoneyGreen;
  ACanvas.FillRect(AViewInfo.Bounds);
  ADone := True;
end;
cpp
void __fastcall TForm1::cxGrid1TableView1RowLayoutCustomDrawRowSelection(
  TcxGridTableView *Sender, TcxCanvas *ACanvas,
  TcxCustomGridCellViewInfo *AViewInfo, bool &ADone)
{
  ACanvas->Brush->Color = clMoneyGreen;
  ACanvas->FillRect(AViewInfo->Bounds);
  ADone = true;
}

The following events of row layout settings reference the TcxGridRowLayoutCustomDrawEvent procedure type:

See Also

cxGridTableView Unit