Deepa Sudhir

Deepa Sudhir

  • NA
  • 35
  • 21.2k

To expand the child node and highlight the parent

Mar 9 2015 11:30 PM

I have 3 levels in my treeview

Parent

------Child1

------Child2

-------------Child2-1

---------------------Child2-1-1

-------------Child2-2

------Child3

When I click child2 I am able to expand it and view child2-1 and child2-2

But I'm not able to expand Child2-1

This is what I tried in my code--------------

 protected void TreeViewArtMaterial_DataBound(object sender, EventArgs e)
        {
            if (Request.QueryString.Keys.Count > 0)
            {
                int intCatID = 0;
                int intSubCatID = 0;
                int intSubSubId = 0;

                intCatID = Int32.Parse(ContentPlaceHolder1.Page.Request.QueryString["CatId"]);

                if (intCatID != 0)
                {
                    intSubCatID = Int32.Parse(ContentPlaceHolder1.Page.Request.QueryString["SubCatID"]);

                    if (Request.QueryString.Keys.Count > 2)
                    {
                        //Third level nodes;
                        //TreeViewArtMaterial.Nodes[intCatID - 1].ChildNodes[intSubCatID - 1].ChildNodes[intSubSubId-1].Expand();
                       ???????
                    }
                    else
                    {                      
                        TreeViewArtMaterial.Nodes[intCatID - 1].ChildNodes[intSubCatID - 1].Expand();
                    }
                  


                }//if (intCatID != 0)
            }//if count

        }


 


Answers (1)