The following code works great on fncgrid:
procedure TSalesForm.FormCreate(Sender: TObject);
begin
GetSettings;
Salesgrid.rowheights[1] := 70;
Salesgrid.rowheights[0] := 42;
LABEL5.PrefixStyle := TPrefixStyle.NoPrefix;
LABEL1.PrefixStyle := TPrefixStyle.NoPrefix;
end;
Thanks
Garnett
Pieter
(Pieter)
2
This also works on TTMSFNCDataGrid, can you provide some more insight or a more complete code snippet / sample?
procedure TXOForm.FormCreate(Sender: TObject);
begin
FDQUERY2.Close;
XORDATAGRID.BeginUpdate;
xorDATAGrid.rowheights[0] := 185;
xorDATAGrid.rowheights[1] := 150;
XORDATAgrid.COLUMNS[2].EditorItems.CLEAR;
XORDATAgrid.Columns[4].EditorItems.CLEAR;
XORDATAgrid.Columns[5].EditorItems.CLEAR;
XORDATAgrid.Columns[7].EditorItems.CLEAR;
fdquery2.SQL.Clear;
fdquery2.Open('select name, ADDR from LOCATIONGROUP2 WHERE ACTIVEFLAG = TRUE order by name');
while not FDQUERY2.EOF do
BEGIN
XORDATAgrid.Columns[2].EditorItems.Add(FDQUERY2.FieldByName('NAME').AsString);
XORDATAGrid.Columns[4].EditorItems.Add(FDQUERY2.FieldByName('ADDR').AsString);
XORDATAgrid.Columns[5].EditorItems.Add(FDQUERY2.FieldByName('NAME').AsString);
XORDATAGrid.Columns[7].EditorItems.Add(FDQUERY2.FieldByName('ADDR').AsString);
FDQUERY2.Next;
END;
XORDATAGRID.EndUpdate;
FDQUERY2.Close;
GetSettings;
end;
procedure TXOForm.FormShow(Sender: TObject);
begin
// xordatagrid.RowCount := 2;
// xoritemsDATAGrid.rowheights[0] := 60;
Label0.Text := 'User: '+dm.FDConnection1.Params.UserName;
end;
procedure TXOForm.XORDataGridGetCellLayout(Sender: TObject;
ACell: TTMSFNCDataGridCell);
begin
if Acell.row < XORDataGrid.FixedRowCount then
begin
Acell.Layout.TextAlign := TTMSFNCGraphicsTextAlign.gtaCenter;
acell.layout.Font.Style := [tfontstyle.fsUnderline,tfontstyle.fsBold];
acell.layout.Font.Size := 15;
acell.layout.WordWrapping := TRUE;
end
else
begin
Acell.layout.Font.Style := [tfontstyle.fsBold];
Acell.layout.Font.Size := 11;
end;
end;
procedure TXOForm.TabItem1Click(Sender: TObject);
begin
CALLOUTPANEL5.Visible := FALSE;
CREATEXO.Enabled := TRUE;
DeleteXOR.Enabled := False;
XORITEMDelete.Enabled := False;
listparts.Enabled := FALSE;
PANEL14.Visible := FALSE;
xordatagrid.Filter.Clear;
IF NOT FDTBL1.Active THEN
BEGIN
FDTbl1.OPEN;
XORDATAGridDatabaseAdapter.Active := true;
FDTbl2.Open;
END;
xorDataGrid.CollapseAllNodes;
end;
I hope this enough to see my issue
Thanks
Garnett
Pieter
(Pieter)
4
Hi, you might want to set rowheights after opening the dataset.
Thanks that worked
Is there away to lock it, so if I close reopen dataset, it appears that I have to set it again.
Thanks
Garnett
Pieter
(Pieter)
6
When closing the dataset rows are removed and also the info attached to the row so it needs to be set again