Discussions
Sign In
•
Register
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In with LMD account
Sign In with LMD account
Categories
Recent Discussions
Categories
All Categories
1.1K
NG Controls
28
Announcements
60
LMD IDE-Tools
209
LMD ElPack
373
LMD-Tools
415
Feature Requests
38
In this Discussion
Carlo Marangoni
April 2023
Eugene Balabuev (LMD)
April 2023
LMDGrid add a column
Carlo Marangoni
April 2023
in
LMD ElPack
Vote Up
0
Vote Down
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:
lmdgrid
Comments
2 Comments
sorted by
Votes
Date Added
Eugene Balabuev (LMD)
April 2023
Posts: 0
Accepted Answer
Vote Up
0
Vote Down
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
Carlo Marangoni
April 2023
Posts: 22
Vote Up
0
Vote Down
Thank you, that's great.
Sign In
or
Register
to comment.
Comments