Contents - Index - Previous - Next


OnGetDrawState event



Applies to
TProfGrid component

Declaration
property OnGetDrawState: TProfGridGetDrawStateEvent;

Description

Provides a way to change the default drawing attributes of a cell.


Examples


The following event handler makes the cell [2,3] look like a fixed cell:

procedure TForm1.ProfGrid1GetDrawState(Sender: TProfGrid; ACol,
  ARow: Integer; var AState: TGridDrawState; var AColor: TColor);
begin
  if (ACol = 2) and (ARow = 3) then
  begin
    Include(AState, gdFixed);
    AColor := Sender.FixedColor
  end
end;


The following event handler "stripes" rows:

procedure TForm1.ProfGrid1GetDrawState(Sender: TProfGrid; ACol,
  ARow: Integer; var AState: TGridDrawState; var AColor: TColor);
begin
  if (ACol >= Sender.FixedCols) and (ARow >= Sender.FixedRows) then
    if Odd(ARow) then
      AColor := clWindow
    else
      AColor := clAqua
end;