Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.01.31;
Скачать: 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 вся ветка

Текущий архив: 2002.01.31;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.01 c
1-99984
helper
2002-01-13 07:03
2002.01.31
Реестр


3-99921
П.
2001-12-25 17:53
2002.01.31
БД


14-100063
panov
2001-12-11 15:37
2002.01.31
Угадайте, очем речь?


3-99870
DiggerAbstract
2001-12-27 04:26
2002.01.31
PLZ.


4-100121
Relaxoid
2001-12-04 23:54
2002.01.31
Выключение Win2000