How can I make a specific column to take up the rest of the space e.g. equivalent to TAlignLayout.Client?
Sorry, this feature is currently unfortunately not yet built-in.
It is a good suggestion we'll consider for a future update.
Hello,
I don't know if this feature is now built-in : I could not find TMSFMX method but I am a beginner with TMS Firemonkey Pack.
Instead of it, I use my code I made myself :
procedure TForm1.TMSgridApplyStyleLookup(Sender: TObject);
begin
With TTMSFMXGrid(Sender) do AutoSizeRows();
ColMaxSize(TTMSFMXGrid(Sender), 1);
end;
with
procedure TForm1.ColMaxSize(aTMSFMXGrid : TTMSFMXGrid; aCol : integer);
var
iCol, iRow : integer;
tWidth, tHeight : single;
bVScrollVisible : Boolean;
begin
bVScrollVisible := False;
with aTMSFMXGrid do
begin
tHeight := 0;
if RowCount > 1 then
for iRow :=1 to RowCount -1 do
begin
tHeight := tHeight + RowHeights[iRow];
if tHeight > Height then
begin
bVScrollVisible := True;
Break;
end;
end;
tWidth := Width;
if bVScrollVisible then
tWidth := tWidth -(width - GetCellWrapper.Width);
for iCol := 0 to ColumnCount -1 do
if iCol <> aCol then
if not IsHiddenColumn(iCol) then tWidth := tWidth - ColumnWidths[iCol];
if tWidth > 0 then
ColumnWidths[aCol] := tWidth;
Resize;
end;
end;
Regards.
Optimized version :
procedure TForm1.ColMaxSize(aTMSFMXGrid : TTMSFMXGrid; aCol : integer);
var
iCol: integer;
tWidth: Single;
begin
with aTMSFMXGrid do
begin
if (aCol > ColumnCount -1)
or (IsHiddenColumn(aCol)) then Exit;
tWidth := Width - (Width - GetCellWrapper.Width);
if ColumnCount - HiddenColumnCount > 0 then
begin
for iCol := 0 to ColumnCount -1 do
if iCol <> aCol then
if not IsHiddenColumn(iCol) then
tWidth := tWidth - ColumnWidths[iCol];
if tWidth > 0 then
begin
ColumnWidths[aCol] := tWidth;
Resize;
end;
end;
end;
end;
Hi,
we will investigate here if we can implement such a functionality in the TTMSFMXGrid.
Kind Regards,
Pieter