Library Vcl NextSuite 6 NextGrid6 Reference Classes TNxCustomGrid6 OnCustomDrawHeader

OnCustomDrawHeader

An event called while a header for each column is being drawn.

pas
property OnCustomDrawHeader: TNxHeaderDrawEvent read FOnCustomDrawHeader write FOnCustomDrawHeader;

In order to this event to be triggered, doCustom need to be included in DrawingOptions of the Header.

Parameters

Index
Index of a column being currently drawn.

HeaderRect
Rectangle of a single header cell, one being currently drawn.

Example

pas
procedure TForm1.GridCustomDrawHeader(Sender: TObject; Index: Integer; HeaderRect: TRect; HeaderState: TNxButtonState);
begin
  with Grid.Canvas do
  begin
    Brush.Color := clSkyBlue;
    FillRect(HeaderRect);
    if not (bsPressed in HeaderState) then
      FadeVert(Grid.Canvas, HeaderRect);
  end;
end;

Sign in