In DBGrid, we output data (from the MSSQL server, from the view), the OnCellClick handler is written, does what is required of it. The problem is this: you need cells that have been "clicked" to paint / delete values / make font color = background color - no difference. I got to something like this:
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin if gdSelected in State then begin with DBGrid1.Canvas do begin Brush.Color:=clWhite; Font.Color:=clWhite; FillRect(Rect); end; end; end; However, only the selected cell is filled, after selecting another cell, the fill disappears. How can I save the shading of "clicked" cells?