In the Oncustomdrawcell event of Cxgriddbtableview
Begin
atext:=inttostr (Arecord.index);
End
Procedure Tmain_form.cxgrdbtblvwgrid1dbtableview1customdrawcell (
Sender:tcxcustomgridtableview; Acanvas:tcxcanvas;
Aviewinfo:tcxgridtabledatacellviewinfo; var adone:boolean);
Var
Arec:trect;
Begin
A particular line becomes color *****************************
if (Aviewinfo.gridrecord.values[tcxgriddbtableview (Sender). Getcolumnbyfieldname
(' Shebeibianhao '). Index]) = ' 20050419 ' Then
//
Begin
ACanvas.Brush.Color: = clred;
End
Alternating color ************************
If AViewInfo.RecordViewInfo.Index mod 2 = 0 Then
Begin
ACanvas.Canvas.brush.color: = CLINFOBK;
End
Else
Begin
ACanvas.Canvas.brush.color: =clgreen;
End
Spacer Variable Color **************************
If AViewInfo.Item.Index mod 2 = 0 Then
ACanvas.Canvas.brush.color: = Clgreen
Else
ACanvas.Canvas.brush.color: = Clgraytext;
Sets the color of the line **************************
Begin
AREC: = Aviewinfo.bounds;
Acanvas.canvas.brush.color:= Clgreen;
Acanvas.fillrect (AREC)
End
Sets the color of the cell **************************
Begin
AREC: = Aviewinfo.clientbounds;
Acanvas.canvas.brush.color:= clgradientactivecaption;
Acanvas.canvas.font.color:=clgreen; Font color settings
Acanvas.fillrect (AREC)
End
//***********************************************
End
Cxgrid row, column color control