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

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 вся ветка

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



Память: 0.45 MB
Время: 0.027 c
3-1078401153
LAndreyV
2004-03-04 14:52
2004.04.04
Query1.Delete - иногда работает, а иногда выдает ошибку


11-1059477443
avakss
2003-07-29 15:17
2004.04.04
KOL+отключить показ программы в CTRL+ALT+DEL


9-1063816318
witalick
2003-09-17 20:31
2004.04.04
Игра на Delphi/Flash


3-1078493919
tomek
2004-03-05 16:38
2004.04.04
developer express 4.11 глюк


14-1078658912
Undert
2004-03-07 14:28
2004.04.04
Flash




   Наверх