Главная страница
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.013 c
1-99939
StelZ
2002-01-10 21:38
2002.01.31
CGI & Kilyx???


1-99945
GovoRun
2002-01-13 23:34
2002.01.31
Создание MDIChild в run-time


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


3-99844
Аль
2001-12-25 13:17
2002.01.31
Пример о DCOM


7-100091
ReNoiZer
2001-10-18 17:57
2002.01.31
Убедительная просьба к Mystic...