This is a migrated thread and some comments may be shown as answers.

Upgrading Problems

1 Answer 75 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
PPI Itdept
Top achievements
Rank 1
PPI Itdept asked on 15 Jul 2008, 02:21 PM
I was developing in the trial version Q3 2007 and just purchased Q1 2008. I noticed that has been tons of changes between the two and I'm stuck. In the previous version e.NodeClicked was valid but no longer exists in the new version. Could someone point me in the right direction cause I'm lost at this point.

 protected void RadTreeView1_NodeExpand(object o, RadTreeNodeEventArgs e)  
    {  
        // This fires when a + sign is clicked and the tree expands  
        switch (e.NodeClicked.Category)  
        {  
            case "Category":  
                if (PDM.GlobalVariable.NodeID == "CategoryID")  
                {  
                    AddSubCategoryNodes(e.NodeClicked);  
                }  
                AddProductNodes(e.NodeClicked);  
                break;  
            case "Product":  
                AddVariantNodes(e.NodeClicked);  
                break;  
            case "Variant":  
                AddSizeNodes(e.NodeClicked);  
                break;  
            default:  
                break;  
        }  
    }  
    private void AddSubCategoryNodes(RadTreeNode parentNode)  
    {  
        // Add to tree when SubCategories are present  
                  
        DataTable dt = GetCategoryNodeData(int.Parse(parentNode.Value));  
        foreach (DataRow row in dt.Rows)  
        {  
            RadTreeNode node = new RadTreeNode();  
 
            node.Text = (string)row[PDM.GlobalVariable.NodeName];  
            node.Value = ((int)row[PDM.GlobalVariable.NodeID]).ToString();  
            node.CssClass = "Normal";  
            node.HoveredCssClass = "Normal";  
            node.Category = "Category";  
 
            if (getChildCount("Category", (int)row[PDM.GlobalVariable.NodeID]) > 0)  
            {  
                node.ExpandMode =  TreeNodeExpandMode.ServerSideCallBack;  
            }  
 
            parentNode.Nodes.Add(node);  
        }  
          
 
    }  
    private void AddProductNodes(RadTreeNode parentNode)  
    {  
        // Add to tree when product is present  
        bool Test = false;  
        RadTreeNode addNode = new RadTreeNode();  
           
        DataTable dt = GetProductNodeData(int.Parse(parentNode.Value));  
        foreach (DataRow row in dt.Rows)  
        {  
            if (Test == false)  
            {  
                addNode.Text = "Add Product";  
                addNode.Value = "0";  
                addNode.Category = "Product";  
                addNode.CssClass = "FirstNode";  
                addNode.HoveredCssClass = "OverNode";  
                addNode.NavigateUrl = "AddProduct.aspx?CategoryID=" + parentNode.Value + "&SystemID=11";  
                addNode.Target = "Radpane8";  
                parentNode.Nodes.Add(addNode);  
                Test = true;  
            }  
             
            RadTreeNode node = new RadTreeNode();  
            node.Text = (string)row["Name"];  
              
            node.Value = ((int)row["ProductID"]).ToString();  
            nodeSystem = ((int)row["SystemID"]).ToString();  
            node.Category = "Product";  
            node.NavigateUrl = "Product.aspx?ProductID=" + node.Value + "&SystemID=" + nodeSystem;  
            node.Target = "Radpane8";  
            if (getChildCount("Product", (int)row["ProductID"]) > 0)  
            {  
                node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;  
            }  
 
            parentNode.Nodes.Add(node);  
        }  
         
 
    } 
Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 15 Jul 2008, 02:30 PM
Hi PPI Itdept,

I think this help topic will help you. It summarizes the differences between RadTreeView "Classic" and RadTreeView for ASP.NET Ajax.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
PPI Itdept
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or