当前位置: 首页>>代码示例>>C#>>正文


C# TreeView.ExpandAll方法代码示例

本文整理汇总了C#中System.Web.UI.WebControls.TreeView.ExpandAll方法的典型用法代码示例。如果您正苦于以下问题:C# TreeView.ExpandAll方法的具体用法?C# TreeView.ExpandAll怎么用?C# TreeView.ExpandAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.UI.WebControls.TreeView的用法示例。


在下文中一共展示了TreeView.ExpandAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            getData a = new getData();
            a.ReadDigest();
            TreeView S = new TreeView();

            foreach(string Name in a.NameDigest){
                TreeNode root = new TreeNode(Name);
                S.Nodes.Add(root);
            }

            S.ExpandAll();
            this.Page.Form.Controls.Add(S);
        }
开发者ID:cibergod,项目名称:clikoExplorer,代码行数:14,代码来源:Default.aspx.cs

示例2: Create_TreeView_From_Collections

        private void Create_TreeView_From_Collections(TreeView treeView1)
        {
            // Save the current home type
            TreeNode rootNode = new TreeNode("Collection Hierarchy") {SelectAction = TreeNodeSelectAction.None};
            treeView1.Nodes.Add(rootNode);

            // Step through each node under this
            SortedList<string, TreeNode> sorted_node_list = new SortedList<string, TreeNode>();
            foreach (Item_Aggregation_Related_Aggregations childAggr in Hierarchy_Object.Children)
            {
                if ((!childAggr.Hidden) && ( childAggr.Active ))
                {
                    // Set the aggregation value, for the redirect URL
                    currentMode.Aggregation = childAggr.Code.ToLower();

                    // Set some default interfaces
                    if (currentMode.Aggregation == "dloc1")
                        currentMode.Skin = "dloc";
                    if (currentMode.Aggregation == "edlg")
                        currentMode.Skin = "edl";

                    // Create this tree node
                    TreeNode childNode = new TreeNode("<a href=\"" + currentMode.Redirect_URL() + "\"><abbr title=\"" + childAggr.Description + "\">" + childAggr.Name + "</abbr></a>");
                    if (currentMode.Internal_User)
                    {
                        childNode.Text = string.Format("<a href=\"{0}\"><abbr title=\"{1}\">{2} ( {3} )</abbr></a>", currentMode.Redirect_URL(), childAggr.Description, childAggr.Name, childAggr.Code);
                    }
                    childNode.SelectAction = TreeNodeSelectAction.None;
                    childNode.NavigateUrl = currentMode.Redirect_URL();

                    // Add to the sorted list
                    if ((childAggr.Name.Length > 4) && (childAggr.Name.IndexOf("The ") == 0 ))
                        sorted_node_list.Add(childAggr.Name.Substring(4).ToUpper(), childNode);
                    else
                        sorted_node_list.Add(childAggr.Name.ToUpper(), childNode);

                    // Check the children nodes recursively
                    add_children_to_tree(childAggr, childNode);

                    currentMode.Skin = String.Empty;
                }
            }

            // Now add the sorted nodes to the tree
            foreach( TreeNode childNode in sorted_node_list.Values )
            {
                rootNode.ChildNodes.Add(childNode);
            }

            currentMode.Aggregation = String.Empty;

            if ((currentMode.Home_Type == Home_Type_Enum.Tree_Expanded) || ( currentMode.Is_Robot ))
            {
                treeView1.ExpandAll();
            }
            else
            {
                treeView1.CollapseAll();
                rootNode.Expand();
            }
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:61,代码来源:Aggregation_HtmlSubwriter.cs

示例3: pageLoadExpandAll

		public static void pageLoadExpandAll (Page page) {
			TreeView tv = new TreeView ();
			tv.EnableClientScript = false;
			tv.ID = "treeview1";
			XmlDataSource xmlds = new XmlDataSource ();
			xmlds.EnableCaching = false;
			xmlds.Data = xmlDataBind;
			tv.DataSource = xmlds;
			tv.DataBind ();
			tv.ExpandAll ();
			LiteralControl lcb = new LiteralControl (HtmlDiff.BEGIN_TAG);
			LiteralControl lce = new LiteralControl (HtmlDiff.END_TAG);
			page.Form.Controls.Add (lcb);
			page.Form.Controls.Add (tv);
			page.Form.Controls.Add (lce);
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:16,代码来源:TreeViewTest.cs

示例4: OrgTreeBind

 public void OrgTreeBind(TreeView tv)
 {
     tv.Nodes.Clear();
     if (CookieManager.GetCookieValue("uid") != "0")
     {
         IndustryPlatform.Model.SYS_Organization m = GetModel(CookieManager.GetCookieValue("orgID"));
         TreeNode n = new TreeNode(m.OrgName, m.OrgCode);
         tv.Nodes.Add(n);
         OrgTreeBind(m.OrgCode, n, tv);
     }
     else
         OrgTreeBind("-1", (TreeNode)null, tv);
     tv.ExpandAll();
 }
开发者ID:SaintLoong,项目名称:ChangWu_IndustryPlatform,代码行数:14,代码来源:SYS_Organization.cs


注:本文中的System.Web.UI.WebControls.TreeView.ExpandAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。