چطوری میشه رنگ بعضی از سطرهای DBGrid رو عوض کرد؟
Printable View
چطوری میشه رنگ بعضی از سطرهای DBGrid رو عوض کرد؟
باید در رویداد OnDrawColumnCell کدی شبیه به این بنوسید:
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if {some conditions} then
DBGrid1.Canvas.Brush.Color := clRed; //or any other colors
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;