I'm trying to manipulate a TGridPanelLayout dynamically. Why doesn't this code work? It doesn't show anything - the grid is blank.
self.OverviewGrid.RowCollection.Clear;
self.OverviewGrid.ColumnCollection.Clear;
self.OverviewGrid.ColumnCollection.Add;
self.OverviewGrid.ColumnCollection.Items[0].SizeStyle:=TGridPanelLayout.TSizeStyle.Absolute;
self.OverviewGrid.ColumnCollection.Items[0].Value:=100;
for i := 0 to length(Array_Grid_Labels)-1 do
begin
t:=TButton.Create(self);
t.Align:=TAlignLayout.Client;
t.Text:='test';
t.Font.Size:=11;
t.FontColor:=TAlphaColors.Black;
self.OverviewGrid.RowCollection.Add;
self.OverviewGrid.RowCollection.Items[i].SizeStyle:=TGridPanelLayout.TSizeStyle.Absolute;
self.OverviewGrid.RowCollection.Items[i].Value:=30;
self.OverviewGrid.ControlCollection.AddControl(t,0,i);
end;
Using Delphi Seattle to develop for iOS/Android (FMX)
To Note:
self.OverviewGrid.AddObject(t);
does give me the desired results, but that still leaves me unable to manipulate the grid in the displayed, desired way above.