最后不要根据dbedit去判断啊!
直接在Jdbctrgrid的ONDrawColumnCell事件里面写代码就可以啦!
if (qryMatSF.FieldByName('Sex').AsString = '男') then
(Sender as Jdbctrgrid).Canvas.Brush.Color := RGB(255,217,236)
else
(Sender as Jdbctrgrid).Canvas.Brush.Color := clCream;
if gdSelected in State then
(Sender as Jdbctrgrid).Canvas.Brush.Color := clHighLight;
(Sender as Jdbctrgrid).DefaultDrawColumnCell(Rect, DataCol, Column, State);
不太清楚能不能运行啊,我是用dbgrid的!