ramoreia
asked on
DBGrid Color Change
I need that when the user enters a row in the DBGrid that row changes to a different color like 'clInfoBk'. I need the whole row and not just the Collumn Cell.
dbgrid1.columns[1].color := clInfoBk;
Set dgRowSelect to true in Option then
procedure TForm1.DBGrid1DrawDataCell (Sender: TObject; const Rect: TRect;
Field: TField; State: TGridDrawState);
begin
if gdselected in state then
TDBGrid(Sender).Canvas.Bru sh.Color := clInfoBk
else
TDBGrid(Sender).Canvas.Bru sh.Color := clWindow;
TDBGrid(Sender).DefaultDra wDataCell( Rect, Field, State);
end;
procedure TForm1.DBGrid1DrawDataCell
Field: TField; State: TGridDrawState);
begin
if gdselected in state then
TDBGrid(Sender).Canvas.Bru
else
TDBGrid(Sender).Canvas.Bru
TDBGrid(Sender).DefaultDra
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
dgRowSelect to True