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

Как изменить цвет одной ячейки в DBGrid   Найти похожие ветки 

 
murtazi   (2003-08-01 17:20) [0]

Как изменить цвет одной ячейки в DBGrid


 
horse ©   (2003-08-01 17:59) [1]

Изменит все ячейки поля FieldName, значения к-рых < 0


procedure ToRest.DBGridEh1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumnEh;
State: TGridDrawState);
begin

if Column.FieldName = "FieldName" then
if Column.Field.AsFloat < 0 then
( Sender) Изменит все ячейки поля FieldName, значения к-рых < 0


procedure ToRest.DBGridEh1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumnEh;
State: TGridDrawState);
begin

if Column.FieldName = "FieldName" then
if Column.Field.AsFloat < 0 then
TDBGridEh(Sender).Canvas.Brush.Color := clRed;

TDBGridEh(Sender).DefaultDrawColumnCell(Rect,DataCol,Column,State);

end;


 
murtazi   (2003-08-01 18:11) [2]

Большое Спасибо!


 
ulyanitsky ©   (2003-08-01 20:07) [3]

А в стандартном DBGRID как?


 
Hawk2   (2003-08-01 23:49) [4]

Также, только событие будет называться DBGrid1DrawColumnCell и т.д.



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

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



Память: 0.45 MB
Время: 0.009 c
4-92310
Fel
2003-06-20 18:43
2003.08.28
Сообщения


6-92164
Lamer111
2003-06-21 00:19
2003.08.28
чат и интернет


3-92038
Cherepovets
2003-08-04 13:22
2003.08.28
TAble и удаление....


1-92107
avec
2003-08-15 12:56
2003.08.28
NMSMTP - почему не работает try... except?


6-92157
Isya
2003-06-07 02:16
2003.08.28
Сетевой трафик?




   Наверх