Thema: Delphi TMS AdvGrid - Anleitung

Einzelnen Beitrag anzeigen

s-off
(Gast)

n/a Beiträge
 
#2

Re: TMS AdvGrid - Anleitung

  Alt 14. Aug 2007, 09:53
Hallo,

Delphi-Quellcode:
Procedure TForm1.FormShow(Sender: TObject);
Begin
   sg := TAdvStringGrid.Create(self);
   sg.Parent := self;
   sg.Options := [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goEditing];
   sg.AddCheckBox(1, 1, False, False);
   sg.Cells[1, 1] := 'Checkbox';
   sg.OnGetEditorType := GetEditorType;
End;

Procedure TForm1.GetEditorType(Sender: TObject; aCol, aRow: Integer; Var aEditor: TEditorType);
Begin
   With sg Do Begin
      Case ACol Of
         2: Begin
               aEditor := edComboList;
               Combobox.Items.Add('eins');
               Combobox.Items.Add('zwei');
               Combobox.Items.Add('drei');
            End;
      End;
   End;
End;
  Mit Zitat antworten Zitat