Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

LMDGrid add a column

Can you please explain in detail the right way to create or add a column to a data grid in code?
I looked through the manual, there isn't a lot of information on this.
Tagged:

Comments

  • 2 Comments sorted by Votes Date Added
  • You have to create a column object and then add it to grid like this:

    procedure TForm15.Button1Click(Sender: TObject);
    var
      cn: TLMDGridTextColumn;
    begin
      cn := TLMDGridTextColumn.Create(Self);
      cn.Title.Caption := 'My column';
      cn.Width := 150;

      LMDGrid1.Columns.Add(cn);
    end;

    The following column classes are available:
    • TLMDGridTextColumn
    • TLMDGridIntegerColumn
    • TLMDGridDateColumn
    • TLMDGridFloatColumn
    • TLMDGridCheckBoxColumn
    • TLMDGridImageColumn
    • TLMDGridRatingColumn
    • TLMDGridProgressColumn


  • Thank you, that's great.
Sign In or Register to comment.