L laoyou Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-11 #1 如何实现一个 dbgrid 显示时和其数据源刷新时, 每一条记录某个字段如果满足一定条件,其所在cell 颜色的改变,[][]
Z zjok Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-11 #2 procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState); begin if Table1.FieldByName('Size').AsFloat > 10 then DBGrid1.Canvas.Font.Color := clRed; DBGrid1.DefaultDrawDataCell(Rect, Field, State); end;
procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState); begin if Table1.FieldByName('Size').AsFloat > 10 then DBGrid1.Canvas.Font.Color := clRed; DBGrid1.DefaultDrawDataCell(Rect, Field, State); end;
R robertcool Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-11 #4 看看Rx的Dbgrid和DevExpress的DBGrid还有更漂亮的
L laoyou Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-17 #5 我后来是在oncolloumdraw(正确的写法不记得了,参考一下吧),中实现的, 用的是zjok的,[][]