Treeview problems with childnodes depth
-
Hi, I have the following treeview, wich works perfect if I only have a depth of childnodes of one. But my problem is that my menu has a childnode depth of two.... Like this Home Products --Dogs ----Food ----Brushes --Cats ----Food ----Brushes --Horses Links My code only expand (when I click on Products) and shows Home Products --Dogs --Cats --Horses Links When I try to clik on Dogs - it does'nt expand the nex childnode (Food and Brushes)..... I tried to made a "Run to curser", and I can see, it does not go back to the server, and runs TreeNodePopulate. Can anyone help me? I want to expand also when I click on Dogs and so on. My code: aspx: aspx.cs: public partial class Admin_SideAdm : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { ANSIApi api = new ANSIApi(); if (IsPostBack == false) { try { if (api.GetTopMenu(MenuTree) == ANSIApi.FStatus.Success) { } } catch { } } } protected void MenuTree_TreeNodePopulate(object sender, TreeNodeEventArgs e) { //hvis der ikke er nogen child nodes til noden if (e.Node.ChildNodes.Count == 0) { try { api.GetSubMenu(e.Node); } catch { } } } protected void MenuTree_TreeNodeCollapsed(object sender, TreeNodeEventArgs e) { try { int key_id = Convert.ToInt32(e.Node.Value); lblMenuId.Text = key_id.ToString(); lblMenuId.Visible = true; } catch { } } protected void MenuTree_TreeNodeExpanded(object sender, TreeNodeEventArgs e) { try { int key_id = Convert.ToInt32(e.Node.Value); lblMenuId.Text = key_id.ToString(); lblMenuId.Visible = true; if (e.Node.Depth ==