AdvStringGrid ChildNode

Good afternoon to all,

in a advstringgrid j use the addnode procedure to set a row as a start row of a node.

To add a child row there's a InsertChildRow procedure.

But the new row is Always the first row of the node.

If we try to insert 3 child rows in a node loceted to row 2 the result will be



row 1

row 2

      row 2.3 last child row

      row 2.2 second child row

      row 2.1 first child row



It's possible inser a new child row at the end of the child row (the number of the node rows is get by the function GetNodeSpan(ARow: Integer) in order to get





row 1

row 2

      row 2.1 first child row

      row 2.2 second child row

      row 2.3 last child row



Thank's in advance for your interest and help



Best regard



Daniele



PS: on column 0 (fixed by my default) j need to display a text with left alignment.

To do this j use Alignments[0,Arow]:=taLeftJustify but, even idf the text is displyed, the margin from the left fixed colum is very large. How it's possible reduce the margin to 2 from the left fixed column border ??

The second parameter of the InsertChildRow() method determines the position where the row is inserted.
This code snippet applied to a default grid shows how it can be used:


procedure TForm5.Button1Click(Sender: TObject);
begin
  advstringgrid1.InsertChildRow(1,advstringgrid1.GetNodeSpan(1));
  advstringgrid1.Cells[1,advstringgrid1.GetNodeSpan(1)] := inttostr(advstringgrid1.GetNodeSpan(1));
end;

procedure TForm5.FormCreate(Sender: TObject);
begin
  advstringgrid1.LinearFill(false);
  advstringgrid1.AddNode(1,2);
end;