Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problems building a large tree of boxes (Read 2116 times)
Anand
Guest


Problems building a large tree of boxes
Feb 3rd, 2006 at 1:42pm
Print Post  
Hi I am building a very large tree (about 320 nodes and 321 arrows between the nodes). The Flowchart.NET control seems to go belly up when I try this. Here are the problems I am seeing when I build the tree with a layout TopToBottom

The Horizontal scrollbar fails to show up. The vertical is the only one that shows. How can I make the horizontal scrollbar show? If I try zoomtofit I can see all the nodes in there but it doesnt let me scroll in normal view and look at all my nodes. here is my code I tried both with grouping and without grouping as you can see in the code. How can I fix this?

private void GenerateTree(Customer rc)
{
ArrayList al = rc.NetworkAsTree;
foreach(NodeData nd in al)
{
RootNode = CreateBox(nd.Node.Name);
//AssessmentTree.CreateGroup(RootNode);
GenerateNodes(RootNode, nd);
Rearrange();
}
AssessmentTree.RouteAllArrows();
}

private void GenerateNodes(Box Parent, NodeData nd)
{
foreach(NodeData nd1 in nd.Children)
{
Box b = AssessmentTree.FindBox(nd1.Node.Name);
if (b == null)
b = CreateBox(nd1.Node.Name);
//Group parentGroup = AssessmentTree.FindGroup(Parent.Tag);
//parentGroup.AttachToCorner(b, 0);
//AssessmentTree.CreateGroup(b);
AssessmentTree.CreateArrow(Parent, b);
Rearrange();
GenerateNodes(b, nd1);
}
}

private Box CreateBox(string Text)
{
Box b = AssessmentTree.CreateBox(0,0,30,10);
b.Text = Text;
b.Tag = Text;
return b;
}

private void Rearrange()
{
if (treeLayout == null)
{
treeLayout = new TreeLayout(RootNode,
TreeLayoutType.Cascading,
false,
TreeLayoutArrowType.Straight,
TreeLayoutDirection.TopToBottom,
10, 5, true, 10, 10);

}

treeLayout.Arrange(AssessmentTree);
}
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problems building a large tree of boxes
Reply #1 - Feb 3rd, 2006 at 1:56pm
Print Post  
Hi,

Creating or moving items programmatically won't resize automatically the document scrollable area. Try setting larger DocExtents or call the FitDocToObjects method after building the tree.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint