Как сделать, чтобы в DBGrid вместо цифр были соответствующие константы
Falk0ner, вс, 06/07/2008 - 15:34.
procedure TForm1.Grid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
// ВАЖНО: имя поля большими буквами!
if Column.Field.FieldName = 'PLATEZH' then
begin
Grid1.Canvas.FillRect(Rect);
if Column.Field.AsInteger = 0 then
Grid1.Canvas.TextOut(Rect.Left + 1, Rect. + 2, 'наличными')
else
Grid1.Canvas.TextOut(Rect.Left + 1, Rect. + 2, 'безнал');
end;
end;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
// ВАЖНО: имя поля большими буквами!
if Column.Field.FieldName = 'PLATEZH' then
begin
Grid1.Canvas.FillRect(Rect);
if Column.Field.AsInteger = 0 then
Grid1.Canvas.TextOut(Rect.Left + 1, Rect. + 2, 'наличными')
else
Grid1.Canvas.TextOut(Rect.Left + 1, Rect. + 2, 'безнал');
end;
end;
Взято с http://delphiworld.narod.ru
Отправить комментарий