Delphi cxgrid 單元格數據對比,實現自繪標識!
来源:互联网 发布:淘宝店铺总流量怎么看 编辑:程序博客网 时间:2024/04/29 15:02
procedure TRes_HrYd_Approve_F.cxGrid1DBBandedTableView1CustomDrawCell(
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
CheckValue:Integer;
aa,bb,cc,dd,ee,ff,gg,hh,ii,jj:string;
CxColumn,aa1,bb1,cc1,dd1,ee1,ff1,gg1,hh1,ii1,jj1:TcxGridDBBandedColumn;
begin
inherited; //程序自繪
CxColumn:=(Sender as TcxGridDBBandedTableView).GetColumnByFieldName('FLAG');
if CxColumn=nil then Exit;
if SameText(AViewInfo.Item.Name,CxColumn.Name) then
begin
CheckValue:=StrToInt(AViewInfo.GridRecord.Values[cxGrid1DBBandedTableView1Column28.Index]);
if(CheckValue=0) then
begin
AViewInfo.Focused;
ACanvas.Brush.Color:=clRed;
end;
if(CheckValue=1) then
begin
AViewInfo.Focused;
ACanvas.Brush.Color:=clGreen;
end;
if(CheckValue=2) then
begin
AViewInfo.Focused;
ACanvas.Brush.Color:=clFuchsia;
end;
end;
aa1:=(Sender as TcxGridDBBandedTableView).GetColumnByFieldName('XCB');
if aa1=nil then Exit;
if SameText(AViewInfo.Item.Name,aa1.Name) then
begin
aa:=VarToStr(AViewInfo.GridRecord.Values[cxGrid1DBBandedTableView1Column27.Index]);
if (Trim(aa)) <> (Trim(qry_approveyd.FieldByName('YCB').AsString)) then
begin
AViewInfo.Focused;
ACanvas.Brush.Color:=$00B871FF;
end;
end;
bb1:=(Sender as TcxGridDBBandedTableView).GetColumnByFieldName('XBM');
if bb1=nil then Exit;
if SameText(AViewInfo.Item.Name,bb1.Name) then
begin
bb:=VarToStr(AViewInfo.GridRecord.Values[cxGrid1DBBandedTableView1Column1.Index]);
if (Trim(bb)) <> (Trim(qry_approveyd.FieldByName('YBM').AsString)) then
begin
AViewInfo.Focused;
ACanvas.Brush.Color:=$00B871FF;
end;
end;
cc1:=(Sender as TcxGridDBBandedTableView).GetColumnByFieldName('XKB');
if cc1=nil then Exit;
if SameText(AViewInfo.Item.Name,cc1.Name) then
begin
cc:=VarToStr(AViewInfo.GridRecord.Values[cxGrid1DBBandedTableView1Column2.Index]);
if (Trim(cc)) <> (Trim(qry_approveyd.FieldByName('YKB').AsString)) then
begin
AViewInfo.Focused;
ACanvas.Brush.Color:=$00B871FF;
end;
end;
dd1:=(Sender as TcxGridDBBandedTableView).GetColumnByFieldName('XZXB');
if dd1=nil then Exit;
if SameText(AViewInfo.Item.Name,dd1.Name) then
begin
dd:=VarToStr(AViewInfo.GridRecord.Values[cxGrid1DBBandedTableView1Column3.Index]);
if (Trim(dd)) <> (Trim(qry_approveyd.FieldByName('YZXB').AsString)) then
begin
AViewInfo.Focused;
ACanvas.Brush.Color:=$00B871FF;
end;
end;
ee1:=(Sender as TcxGridDBBandedTableView).GetColumnByFieldName('XBMID');
if ee1=nil then Exit;
if SameText(AViewInfo.Item.Name,ee1.Name) then
begin
ee:=VarToStr(AViewInfo.GridRecord.Values[cxGrid1DBBandedTableView1Column13.Index]);
if (Trim(ee)) <> (Trim(qry_approveyd.FieldByName('YBMID').AsString)) then
begin
AViewInfo.Focused;
ACanvas.Brush.Color:=$00B871FF;
end;
end;
ff1:=(Sender as TcxGridDBBandedTableView).GetColumnByFieldName('XBC');
if ff1=nil then Exit;
if SameText(AViewInfo.Item.Name,ff1.Name) then
begin
ff:=VarToStr(AViewInfo.GridRecord.Values[cxGrid1DBBandedTableView1Column14.Index]);
if (Trim(ff)) <> (Trim(qry_approveyd.FieldByName('YBC').AsString)) then
begin
AViewInfo.Focused;
ACanvas.Brush.Color:=$00B871FF;
end;
end;
gg1:=(Sender as TcxGridDBBandedTableView).GetColumnByFieldName('XZJQF');
if gg1=nil then Exit;
if SameText(AViewInfo.Item.Name,gg1.Name) then
begin
gg:=VarToStr(AViewInfo.GridRecord.Values[cxGrid1DBBandedTableView1Column16.Index]);
if (Trim(gg)) <> (Trim(qry_approveyd.FieldByName('YZJQF').AsString)) then
begin
AViewInfo.Focused;
ACanvas.Brush.Color:=$00B871FF;
end;
end;
hh1:=(Sender as TcxGridDBBandedTableView).GetColumnByFieldName('XCBZX');
if hh1=nil then Exit;
if SameText(AViewInfo.Item.Name,hh1.Name) then
begin
hh:=VarToStr(AViewInfo.GridRecord.Values[cxGrid1DBBandedTableView1Column17.Index]);
if (Trim(hh)) <> (Trim(qry_approveyd.FieldByName('YCBZX').AsString)) then
begin
AViewInfo.Focused;
ACanvas.Brush.Color:=$00B871FF;
end;
end;
ii1:=(Sender as TcxGridDBBandedTableView).GetColumnByFieldName('XGW');
if ii1=nil then Exit;
if SameText(AViewInfo.Item.Name,ii1.Name) then
begin
ii:=VarToStr(AViewInfo.GridRecord.Values[cxGrid1DBBandedTableView1Column18.Index]);
if (Trim(ii)) <> (Trim(qry_approveyd.FieldByName('YGW').AsString)) then
begin
AViewInfo.Focused;
ACanvas.Brush.Color:=$00B871FF;
end;
end;
jj1:=(Sender as TcxGridDBBandedTableView).GetColumnByFieldName('XZW');
if jj1=nil then Exit;
if SameText(AViewInfo.Item.Name,jj1.Name) then
begin
jj:=VarToStr(AViewInfo.GridRecord.Values[cxGrid1DBBandedTableView1Column19.Index]);
if (Trim(jj)) <> (Trim(qry_approveyd.FieldByName('YZW').AsString)) then
begin
AViewInfo.Focused;
ACanvas.Brush.Color:=$00B871FF;
end;
end;
end;
- Delphi cxgrid 單元格數據對比,實現自繪標識!
- Delphi cxgrid 單元格數據對比,實現自繪標識!
- delphi cxgrid 使用方法
- delphi cxgrid 使用方法
- delphi——cxGrid
- delphi cxgrid 使用方法
- delphi 2010 cxgrid汉化
- delphi 7 cxgrid 导出
- delphi cxgrid 使用方法
- delphi CxGrid使用小结
- Delphi CxGrid用法详解
- delphi中cxGrid使用技巧
- Delphi CxGrid 汇总(1)
- Delphi CxGrid 汇总(2)
- Delphi CxGrid 汇总(3)
- Delphi CxGrid 汇总(4)
- Delphi CxGrid 汇总(5)
- Delphi CxGrid 汇总(2)
- [读书笔记]把时间当作朋友------把生活节奏调整得慢一点
- 看好了一款牛X的手机,据说是摩托罗拉的翻身之作。里程碑milestone XT702
- 开张大吉
- gtk介绍及api手册下载
- prototype.js 教程(二)
- Delphi cxgrid 單元格數據對比,實現自繪標識!
- Delphi cxgrid 單元格數據對比,實現自繪標識!
- myeclipse8.0以上版本安装插件
- NandFlash系列之一:NorFlash与NandFlash对比
- 抽象类可以没有抽象方法,不能被实例化
- SDL第二课画面的载入和位图传输的优化
- BS系统中,几个常用的小技巧
- ASP.NET配置时候出现:选定的数据存储区出现问题
- 新版中日交流标准日本语初级第二课之应用课文