Вниз
Скачать: CL | DM;

Выделение строки DBGrid цветом   Найти похожие ветки 

 
Havez ©   (2002-01-13 18:45) [0]

Добрых времён!. Подскажите, как мне раскрашивать фон строки в DBGrid, в зависимости от значения некоторого поля таблицы БД?


 
Quest ©   (2002-01-14 09:52) [1]

procedure TForm1.DBGrid2DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
With (Sender as TDBGrid).Canvas Do Begin
IF (Not (gdFocused in State)) AND
((Sender as TDBGrid).DataSource.DataSet.FieldByName("Field_Name").AsBoolean=False)
Then Begin
Font.Color:=clWhite;
Brush.Color:=clRed;
FillRect(Rect);
TextOut(Rect.Left,Rect.Top,Column.Field.Text);
End
Else
(Sender as TDBGrid).DefaultDrawColumnCell(Rect,DataCol,Column,State);
End;
End;


 
Havez ©   (2002-01-15 14:26) [2]

Спасибо, попробую.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.007 c
3-99851
Bachin
2001-12-25 20:51
2002.01.31
IB:Named Transaction in trigger


3-99856
Dush
2001-12-25 17:17
2002.01.31
QuickReport


1-100018
eraser
2002-01-15 14:38
2002.01.31
прерывание цикла


3-99858
Genka
2001-12-26 13:38
2002.01.31
ADO в Delphi 6.0


3-99925
DarT
2001-12-28 12:07
2002.01.31
Два вопроса




   Наверх