Board index » delphi » How to add columns in a TDBGrid component?

How to add columns in a TDBGrid component?

How can i add columns in a TDBGrid component?

The Add method creates and returns a new TColumn  in the
TDBGridColumns object. But i did'nt figure out yet. The help files
dont have any example on Add method for TDBGridColumns object.

Thanks.

        Pedro Branco   :Pedr...@aeisel.aeisel.pt

 

Re:How to add columns in a TDBGrid component?


With DBGRID1 Do
 Begin
  Columns.Add;
  Column[8].FieldName := <your fieldname>;
  Column[8].Caption := 'Test Column';
 end;

You can set the other stuff as well

Will Wilson

Other Threads