在线等:CXGRID实现斑马线的效果。
我的代码如下:
procedure TForm1.cxGrid1DBTableView1CustomDrawCell(
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
begin
inherited;
if dm1.AdoDataSet.RecNo mod 2=0 then
begin
ACanvas.Canvas.Brush.Color :=clBlack;
end
else
begin
ACanvas.Canvas.Brush.Color:=clWhite;
end;
end;
程序运行后,并没显示斑马线的效果,除非鼠标点上该行后,才变色。
请教大家,如何设置CXGRID或如何的代码才能完美实现斑马线的效果。