10600 : Making sure the Gantt is not expanded after load

Question

I am using GTP.NET 2.3.1.
I fill my Gantt with DataBinding on several DataTables. This I’m doing in CGantt_OnNodeInserted(..).
I have Root_Nodes und Sub_Notes in my grid.
I’m tying to set
e.GridNode.Expanded = false;
or
//e.GridNode.Expand(false,true);
at the end of this Event-Handler.
But all my rows are expanded when I see the ganttchart for the first time.
What can I do that the tree is for the first view not expanded.
I have defined a button to expand or collapse my view, this is working fine.
What can I do ?
Is there a event that fires when all gridnodes are created before the gantt is shown ?

Answer

It is better to check if this new node is a child node, and if so to fold the parent.

if (e.GridNode.Parent!=null)
{
   e.GridNode.Parent.Expanded=false;
}

 

Leave a Reply