System.Web.UI.WebControls.TreeView.ExpandAll C# (CSharp) Method

ExpandAll() public method

public ExpandAll ( ) : void
return void
		public void ExpandAll ()
		{
			foreach (TreeNode node in Nodes)
				node.ExpandAll ();
		}
		

Usage Example

        public void Initialize()
        {
            BindCombos();
            BindPoliticas();

            //Microsoft.Web.UI.WebControls.TreeView tvw = (Microsoft.Web.UI.WebControls.TreeView)ES.Web.Global.FindMyControl(Page, "tvWorkflow");
            //tvw.Visible = true;
            //tvw.ExpandLevel = NIVELES_EXPANDIDOS;
            //NodeIndex = tvw.SelectedNodeIndex;

            //if(WorkflowId != -1)
            //{
            //    tvw.TreeNodeSrc = WFPolitica.ObtenerRepresentacionXml(WorkflowId);
            //    tvw.DataBind();
            //}

            System.Web.UI.WebControls.TreeView wft = (System.Web.UI.WebControls.TreeView)Web.Global.FindMyControl(Page, "wfTreeView");
            wft.Visible = true;
            wft.ExpandAll();
            //NodeIndex = wft.SelectedValue;

            if (WorkflowId != -1)
            {
                wft.DataSource = WFPolitica.ObtenerRepresentacionXmlDataSource(WorkflowId);

                // we want the full name displayed in the tree so
                // do custom databindings
                TreeNodeBinding Binding = new TreeNodeBinding();
                Binding.TextField  = "FullName";
                Binding.ValueField = "ID";
                wft.DataBindings.Add(Binding);

                wft.DataBind();

                //string xml = WFPolitica.ObtenerRepresentacionXml(WorkflowId);
                //XmlDocument XDoc = new XmlDocument();
                //XmlDeclaration XDec = XDoc.CreateXmlDeclaration("1.0", null, null);
                //XDoc.AppendChild(XDec);
                //XDoc.LoadXml(xml);
                ////string str = XDoc.OuterXml;

                //// we cannot bind the TreeView directly to an XmlDocument
                //// so we must create an XmlDataSource and assign the XML text
                //XmlDataSource XDdataSource = new XmlDataSource();
                //XDdataSource.ID = DateTime.Now.Ticks.ToString();  // unique ID is required
                //XDdataSource.Data = XDoc.OuterXml;

                //// we want the full name displayed in the tree so
                //// do custom databindings
                //TreeNodeBinding Binding = new TreeNodeBinding();
                //Binding.TextField = "Text";
                //Binding.ValueField = "NodeData";
                //wft.DataBindings.Add(Binding);

                //// Finally! Hook that bad boy up!
                //wft.DataSource = XDdataSource;
                //wft.DataBind();
            }
        }
All Usage Examples Of System.Web.UI.WebControls.TreeView::ExpandAll