We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Control to create a document outline

Thread ID:





103672 May 23,2012 11:21 AM May 29,2012 04:34 PM Windows Forms 1
Tags: FAQ
Asked On May 23, 2012 11:21 AM


I am looking forward to implement a document outline available in visual studio (view->otherwindows->Document Outline) which will list all the control on the designer (I have a custom designer) in a hierarchical form. I looked at a control named "Document explorer", but could not understand how this control can be used and if this can suite what I am looking for.


Davis Jebaraj [Syncfusion]
Replied On May 29, 2012 04:34 PM

Hi Bhavya,


You need to use a TreeView control to implement your own Document outline control. The document explorer you are referring to is specific to the Diagram control and is derived from TreeView to load nodes specific to the Diagram. Please find a code snippet of the code that parses the Diagram document and adds the representative nodes to the tree.


private void ParseChildren(Layer layer, TreeNode nodesParent)


            foreach (INode node in layer.Nodes)


                ParseNode(node, nodesParent);




        private void ParseNode(INode nodeCur, TreeNode nodesParent)


            // Create corresponding TreeNode

            TreeNode nodeTreeTemp = new TreeNode(nodeCur.Name);

            nodeTreeTemp.Tag = nodeCur;


            // if nodeCur is CompositeNode

            // reflect its hierarchy

            if (nodeCur is ICompositeNode)


                ICompositeNode nodeComposite = nodeCur as ICompositeNode;


                if (nodeComposite != null)


                    // Parse composite node's children

                    nodeTreeTemp.ImageIndex = 2;

                    nodeTreeTemp.SelectedImageIndex = 2;

                    ParseChildren(nodeComposite, nodeTreeTemp);

                    nodeTreeTemp.Text = (nodeComposite as INode).Name + " (" + nodeComposite.ChildCount + ")";





                nodeTreeTemp.Tag = nodeCur;

                nodeTreeTemp.ImageIndex = 1;

                nodeTreeTemp.SelectedImageIndex = 1;



            // Add created TreeNode to nodesParent









This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.