Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Treeview problems with childnodes depth

Treeview problems with childnodes depth

Scheduled Pinned Locked Moved ASP.NET
helpdesignsysadminjsonquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    simsen
    wrote on last edited by
    #1

    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 ==

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups