I try to experimenting with quantum grid v 6.36,
As we know that we can draw grid background with the following code:
procedure TForm3.cxGrid1DBTableView1CustomDrawCell(
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
ARec: TRect;
ABitmap: TBitmap;
ATextToDraw: string;
begin
if (AViewInfo is TcxGridTableDataCellViewInfo) then
ATextToDraw := AViewInfo.GridRecord.DisplayTexts[AViewInfo.Item.Index]
else
ATextToDraw := VarAsType(AViewInfo.Item.Caption, varString);
ARec := AViewInfo.Bounds;
ABitmap := TBitmap.Create;
ABitmap.LoadFromFile('canceled.bmp');
ACanvas.Canvas.Brush.Bitmap := ABitmap;
ACanvas.Canvas.FillRect(ARec);
ABitmap.Free;
SetBkMode(ACanvas.Canvas.Handle, TRANSPARENT);
ACanvas.DrawText(ATextToDraw, AViewInfo.Bounds, 0);
ADone := True;
end;
canceled.bmp is just an image with "CANCELED" text on it.
( i developed an sales order application, and when the order is canceled, it will show "canceled" watermark image on the grid)
The question is, is there any other way to draw background image from a text,
i mean it just useles i load an image with just a text on it if we can draw directly the "CANCELED" text on the grid background, and put it in the center of the grid..
any idea how to do this?
any answers with code snippet would greatly appreciated 