delphi dbgrid改变行背景色
procedureTfrmTemp.dbgrdh1DrawColumnCell(Sender:TObject;constRect:TRect;DataCol:Intege...
procedure TfrmTemp.dbgrdh1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
begin
if dbgrdh1.DataSource.DataSet.FieldByName('Mark').AsString = '未编码物料' then
begin
(Sender as TDBGridEh).Canvas.Brush.Color := clRed;
(Sender as TDBGridEh).DefaultDrawDataCell(Rect, Column.Field, State);
end;
end;
提示错误:
[DCC Error] UFrmTemp.pas(459): E2010 Incompatible types: 'DBGridEh.TGridDrawState' and 'UFrmTemp.TGridDrawState' 怎么回事? 展开
DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
begin
if dbgrdh1.DataSource.DataSet.FieldByName('Mark').AsString = '未编码物料' then
begin
(Sender as TDBGridEh).Canvas.Brush.Color := clRed;
(Sender as TDBGridEh).DefaultDrawDataCell(Rect, Column.Field, State);
end;
end;
提示错误:
[DCC Error] UFrmTemp.pas(459): E2010 Incompatible types: 'DBGridEh.TGridDrawState' and 'UFrmTemp.TGridDrawState' 怎么回事? 展开
若以下回答无法解决问题,邀请你更新回答
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询