cxdbgrid 分組顯示後,所有分支全部收縮顯示,如何根據條件使各分支的標題部分變色呢? ( 积分: 50 )

  • 主题发起人 主题发起人 wyxriver
  • 开始时间 开始时间
W

wyxriver

Unregistered / Unconfirmed
GUEST, unregistred user!
我是指分組後那些點‘+’號亦可以展開的一行文字,如何讓這部分文字根據組內某項記錄的內容而變色?
 
procedure&nbsp;Tfrm_main.cxdbgrid4DBTableView1CustomDrawCell(Sender:&nbsp;TcxCustomGridTableView;&nbsp;ACanvas:&nbsp;TcxCanvas;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AViewInfo:&nbsp;TcxGridTableDataCellViewInfo;&nbsp;var&nbsp;ADone:&nbsp;Boolean);<br>var<br>&nbsp;&nbsp;n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16:double;<br>begin<br>&nbsp;&nbsp;if&nbsp;trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column4.index],&nbsp;varString))=''<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;n4:=0&nbsp;else&nbsp;n4:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column4.index],&nbsp;varString)));<br><br>&nbsp;&nbsp;if&nbsp;trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column5.index],&nbsp;varString))=''<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;n5:=0&nbsp;else&nbsp;n5:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column5.index],&nbsp;varString)));<br><br>&nbsp;&nbsp;if&nbsp;trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column6.index],&nbsp;varString))=''<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;n6:=0&nbsp;else&nbsp;n6:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column6.index],&nbsp;varString)));<br><br>&nbsp;&nbsp;if&nbsp;trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column7.index],&nbsp;varString))=''<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;n7:=0&nbsp;else&nbsp;n7:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column7.index],&nbsp;varString)));<br><br>&nbsp;&nbsp;if&nbsp;trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column9.index],&nbsp;varString))=''<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;n9:=0&nbsp;else&nbsp;n9:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column9.index],&nbsp;varString)));<br><br>&nbsp;&nbsp;if&nbsp;trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column10.index],&nbsp;varString))=''<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;n10:=0&nbsp;else&nbsp;n10:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column10.index],&nbsp;varString)));<br><br>&nbsp;&nbsp;if&nbsp;trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column11.index],&nbsp;varString))=''<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;n11:=0&nbsp;else&nbsp;n11:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column11.index],&nbsp;varString)));<br><br>&nbsp;&nbsp;if&nbsp;trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column12.index],&nbsp;varString))=''<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;n12:=0&nbsp;else&nbsp;n12:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column12.index],&nbsp;varString)));<br><br>&nbsp;&nbsp;if&nbsp;trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column15.index],&nbsp;varString))=''<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;n15:=0&nbsp;else&nbsp;n15:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column15.index],&nbsp;varString)));<br><br>&nbsp;&nbsp;if&nbsp;trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column16.index],&nbsp;varString))=''<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;n16:=0&nbsp;else&nbsp;n16:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column16.index],&nbsp;varString)));<br><br>&nbsp;//&nbsp;&nbsp;&nbsp;n4&nbsp;生產數量&nbsp;&nbsp;n5庫存數量&nbsp;&nbsp;&nbsp;n6未過帳進貨驗收&nbsp;&nbsp;n7JIT庫存&nbsp;&nbsp;n8JIT未過帳進貨驗收&nbsp;n9未過帳發料量<br>&nbsp;//&nbsp;&nbsp;n10未過帳退料量&nbsp;&nbsp;n11未過帳內交入&nbsp;&nbsp;n12未過帳費退量(內交)&nbsp;&nbsp;n13&nbsp;&nbsp;n14&nbsp;&nbsp;n15未過帳費領量&nbsp;&nbsp;n16&nbsp;總計<br><br>&nbsp;&nbsp;if&nbsp;&nbsp;(n5+n7-n9-n4-n15&lt;0)&nbsp;and&nbsp;(n5+n7+n6+n8+n11+n10+n12-n15-n9-n4&lt;0)&nbsp;then&nbsp;ACanvas.canvas.Font.Color&nbsp;:=&nbsp;clred;<br>&nbsp;&nbsp;if&nbsp;&nbsp;(n5+n7-n9-n4-n15&lt;0)&nbsp;and&nbsp;(n5+n7+n6+n8+n11+n10+n12-n15-n9-n4&gt;=0)&nbsp;then&nbsp;ACanvas.canvas.Font.Color&nbsp;:=&nbsp;clfuchsia;<br><br><br>end;
 
代码太长了,我是新手,看不懂,帮您顶一下,请高手解决,我也学学
 
接受答案了.
 
后退
顶部