Форум: "Базы";
Текущий архив: 2004.04.04;
Скачать: [xml.tar.bz2];
Вниз
CheckBox в DBGrid Найти похожие ветки
← →
Russko © (2004-03-05 09:24) [0]Созрел такой вопрос - каким образом можно в одно из полей вставить CheckBox? Спасибо!
← →
stas © (2004-03-05 09:26) [1]Поле должно быть типа Boolean.
А там зависит от Controla
← →
Sergey_Masloff (2004-03-05 09:27) [2]
procedure TfmMyFind.DBGrid1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
var
I: Integer;
R: TRect;
begin
if Column.Field = qryFind.FieldByName("SELECTION") then begin
(Sender as TDBGrid).Canvas.FillRect(Rect);
R := Rect;
InflateRect(R, 0, -2);
if qryFind.FieldByName("SELECTION").AsInteger = 1 then
I := DFCS_BUTTONCHECK + DFCS_CHECKED
else
I := DFCS_BUTTONCHECK;
DrawFrameControl((Sender as TDBGrid).Canvas.Handle, R, DFC_BUTTON, I);
end else
(Sender as TDBGrid).DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
← →
stone © (2004-03-05 10:24) [3]if (gdFocused in State) then
if (Column.Field.FieldName = DBCheckBox.Field.FieldName) then
begin
// Вместо стандартного InplaceEditor"а показываем DBCheckBox
DBCheckBox.Left := Rect.Left + DBGrid.Left + (Rect.Right - Rect.Left - DBCheckBox.Width) div 2;
DBCheckBox.Top := Rect.Top + DBGrid.top + 4;
DBCheckBox.Visible := true;
end
Страницы: 1 вся ветка
Форум: "Базы";
Текущий архив: 2004.04.04;
Скачать: [xml.tar.bz2];
Память: 0.44 MB
Время: 0.033 c