I want to simulate Explorer themes for TDBGrid selected row (dgRowSelect), instead of that Blueish color. How can I do that?
Here is a sample of the expected result:
You can use the OnDrawColumnCell event Here's a simple example:
procedure TForm4.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if mydataSet.FieldByName('Age').AsInteger > 18 then
DBGrid1.Canvas.Brush.Color:= clRed;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
Hope this helps
When you say "simulate", I'm not clear how you're intending to choose the selected row background color, but the following should draw it in a standard TDBGrid.