本文整理汇总了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);
}
示例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();
}
}
示例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);
}
示例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();
}