Home > Back-end >  TDD cxGrid has data comparison
TDD cxGrid has data comparison

Time:10-07

Hi,
How to implement the following function to the cxGrid controls,
There are two rows of data, a column from top to bottom line values different, will this column in red font, said,


Thank you very much!

CodePudding user response:


Procedure TForm1. CxGrid1DBTableView1CustomDrawCell (
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxGridTableDataCellViewInfo; Var ADone: Boolean);
{TableView parameters Sender: do you want to achieve special effects;
ACanvas: canvas, this parameter is more important, is to use this parameter to draw special effects;
AViewInfo: the origin of the custom conditions; Gets the cell value for this parameter;
ADone: set to true will not Paint.}
The begin
//traverse column and judgment and values are the same

{AViewInfo. GridRecord. Values [3] : get a column (3 represents the fourth column}
ACanvas. Brush. Color:=clred;//background color change
ACanvas. The Font. Color:=clred;//font color change
end;
  • Related