Board index » delphi » PickList in DBGrid

PickList in DBGrid

Hi,

does anyone know how to put strings in the PickList of a column (DBGrid)
at Runtime?

Thanks a lot for answering!

Jrgen

 

Re:PickList in DBGrid


Now I found the (easy) answer:

procedure TForm1.Button1Click(Sender: TObject);
var
  AutorenListe: TStringList;
  i : integer;
begin

  AutorenListe := TStringList.Create;
  try
    with dm01.TblBuecher do begin
      active := true;
      disableControls;
      First;
      while not eof do begin
        Autorenliste.Add(dm01.TblBuecherAutor.value);
        Next;
      end;
      First;
      EnableControls;
    end;

    DBGridSBuecher.Columns[0].picklist := Autorenliste;
  finally
  Autorenliste.free;
  end;
end;

Juergen Beyer schrieb:

Quote

> Hi,

> does anyone know how to put strings in the PickList of a column (DBGrid)
> at Runtime?

> Thanks a lot for answering!

> Jrgen

Other Threads