参考一下:在dxdbgrid中oncustomdrawcell事件写 if ASelected then afont.Color:=clred; //选中的栏的字体设为红色 scheck:=ANode.Values[dxDBGrid1status.Index]; //dxdbgrid1status为某一个指定字段 if not VarIsNull(scheck) then if scheck = '1' then //这段为指定值的判定,如果为1把这一行定义为白颜色
AColor := clWhite else acolor:=clInfoBk;
在dbgrid的onDrawColumnCell 事件中 with TDbgrid(sender) do begin if DataSource.DataSet.fields[0]=.. then //条件 canvas.Brush.color:=$00E2F3EB else if ... canvas.brush.color:=Clwhite; else if .... DefaultDrawColumnCell(rect,datacol,column,state); end; 以上的 DBGRID中的代码和你所说的控件也是相差无几,一样的道理,参考一下罢
if ASelected then afont.Color:=clred; //选中的栏的字体设为红色
scheck:=ANode.Values[dxDBGrid1status.Index]; //dxdbgrid1status为某一个指定字段
if not VarIsNull(scheck) then
if scheck = '1' then //这段为指定值的判定,如果为1把这一行定义为白颜色
AColor := clWhite
else
acolor:=clInfoBk;
with TDbgrid(sender) do
begin
if DataSource.DataSet.fields[0]=.. then //条件
canvas.Brush.color:=$00E2F3EB
else if ...
canvas.brush.color:=Clwhite;
else if ....
DefaultDrawColumnCell(rect,datacol,column,state);
end;
以上的
DBGRID中的代码和你所说的控件也是相差无几,一样的道理,参考一下罢