Ejemplo n.º 1
0
    protected void ASPxTreeListInTemplate_Init(object sender, EventArgs e)
    {
        ASPxTreeList treeList = (ASPxTreeList)sender;
        GridViewDataItemTemplateContainer templateContainer = (GridViewDataItemTemplateContainer)treeList.NamingContainer;

        treeList.ID = string.Format("tl_{0}", templateContainer.KeyValue);
        treeList.ClientInstanceName = string.Format("tl_{0}", templateContainer.KeyValue);

        TreeListNode nodeParent1 = treeList.AppendNode(1);

        nodeParent1["ID"]      = 1;
        nodeParent1["Details"] = "Details1";

        TreeListNode node1 = treeList.AppendNode(2, nodeParent1);

        node1["ID"]      = 2;
        node1["Details"] = "Details2";
    }
Ejemplo n.º 2
0
 static void BindCore(ASPxTreeList tree, TreeListNode node, XmlElement xmlNode)
 {
     node.SetValue("Text", xmlNode.Attributes["Text"].Value);
     foreach (XmlElement element in xmlNode.ChildNodes)
     {
         TreeListNode child = tree.AppendNode(element.GetAttribute("LinkId"), node);
         BindCore(tree, child, element);
     }
 }