Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxGridTableViewStyles.OnGetGroupStyle Event

In This Article

Occurs when the Table View group row is painted.

#Declaration

Delphi
property OnGetGroupStyle: TcxGridGetGroupStyleEvent read; write;

#Remarks

You can handle the OnGetGroupStyle event to redefine style for the Table View group rows. This event occurs every time when it is necessary to redraw a group row defined by the ARecord parameter. The ALevel parameter specifies the current nesting level.

The Sender parameter determines the Table View containing the row.

The following simple code colors groups based on their level. cxStyleLevel0 and cxStyleLevel1 represent TcxStyle objects created using the style repository. The Color property of the styles is set to $007A96E9 and $00CDEBFF respectively:

procedure TForm1.tvCustomersStylesGetGroupStyle(Sender: TcxGridTableView; ARecord: TcxCustomGridRecord; ALevel: Integer; var AStyle: TcxStyle);
begin
  if ALevel = 0 then
    AStyle := cxStyleLevel0
  else
    AStyle := cxStyleLevel1;
end;

The result of this customization is displayed below:

See Also