iyi günler DBGrid'de istediğim satırı istediğim renge nasıl dönüştürürüm
yani satırlar
sarı
kırmızı
mavi
kırmızı
olabilsin.
ilgilendiğiniz için teşekkürler.
DBGrid satırları renklendirme
Forum kuralları
Forum kurallarını okuyup, uyunuz!
Forum kurallarını okuyup, uyunuz!
dataset içindeki bir bilgiye göre;
DrawColumnCell
if DbGrid3.DataSource.DataSet.FieldByName('print').Value = 't' then
begin // irsaliye yazdırılmış ise skyblue renkte
DbGrid3.Canvas.Font.Color := clNavy;
DbGrid3.Canvas.Brush.Color := clSkyBlue;
DbGrid3.Canvas.FillRect(Rect);
DbGrid3.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
kayıt no.suna göre
DrawDataCell
if odd(DBGrid1.DataSource.DataSet.RecNo) then
DBGrid1.Canvas.Brush.Color := clWhite
else
DBGrid1.Canvas.Brush.Color := clSkyBlue;
DBGrid1.DefaultDrawDataCell(Rect, Field, State);
DrawColumnCell
if DbGrid3.DataSource.DataSet.FieldByName('print').Value = 't' then
begin // irsaliye yazdırılmış ise skyblue renkte
DbGrid3.Canvas.Font.Color := clNavy;
DbGrid3.Canvas.Brush.Color := clSkyBlue;
DbGrid3.Canvas.FillRect(Rect);
DbGrid3.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
kayıt no.suna göre
DrawDataCell
if odd(DBGrid1.DataSource.DataSet.RecNo) then
DBGrid1.Canvas.Brush.Color := clWhite
else
DBGrid1.Canvas.Brush.Color := clSkyBlue;
DBGrid1.DefaultDrawDataCell(Rect, Field, State);