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

TcxCustomVerticalGrid.OnDrawBackground Event

In This Article

Occurs before painting the vertical grid control’s background.

#Declaration

Delphi
property OnDrawBackground: TcxVerticalGridDrawBackgroundEvent read; write;

#Remarks

The OnDrawBackground event is fired when the vertical grid control’s background needs repainting.

The Sender parameter specifies the vertical grid.

The ACanvas parameter specifies the surface being painted.

The R parameter represents the bounding rectangle of the vertical grid’s background.

The AViewParams parameter represents an object containing the display information about the painted area.

The Done parameter specifies whether the default painting routines should be suppressed. Set the parameter to True, to cancel default painting; set it to False, to allow default painting. In the latter case, the changes you make will be discarded.

The following OnDrawBackground event handler fills the background with a bitmap:

Delphi
procedure TStylesSimpleDemoMainForm.cxDBVerticalGridDrawBackground(
  Sender: TObject; ACanvas: TcxCanvas; const R: TRect;
  const AViewParams: TcxViewParams; var Done: Boolean);
var
  AImage: TBitmap;
begin
  AImage := TBitmap.Create;
  AImage.LoadFromFile('c:\images\blue.bmp');
  ACanvas.FillRect(R, AImage);
  Done := True;
  AImage.Free;
end;

The code result is shown in the following image:

See Also