hr_110
دوشنبه 02 آذر 1383, 00:16 صبح
چطوری میشه رنگ بعضی از سطرهای DBGrid رو عوض کرد؟
vcldeveloper
دوشنبه 02 آذر 1383, 04:23 صبح
باید در رویداد 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;
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.