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. Tree View in ASP.NET

Tree View in ASP.NET

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netcomdata-structureshelp
5 Posts 4 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.
  • R Offline
    R Offline
    Rajesh Kumar Chekuri
    wrote on last edited by
    #1

    hi........ we are working on tree view but the problem is tree view is expands every node but i want only one node expands every time, mean if already one node is expanded then we try to expand another then automatically other nodes are collapsed .. Waiting for Response ..............

    Best Regards Rajesh Kumar Chekuri www.rajeshchekuri.co.cc www.funnydotnet.blogspot.com

    M C 2 Replies Last reply
    0
    • R Rajesh Kumar Chekuri

      hi........ we are working on tree view but the problem is tree view is expands every node but i want only one node expands every time, mean if already one node is expanded then we try to expand another then automatically other nodes are collapsed .. Waiting for Response ..............

      Best Regards Rajesh Kumar Chekuri www.rajeshchekuri.co.cc www.funnydotnet.blogspot.com

      M Offline
      M Offline
      meeram395
      wrote on last edited by
      #2

      Not very clear on what you want. So if one node is expanded already and if you try to expand another node, then do you require all the remaining open nodes should be collapsed or it should remain open?

      Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

      R 1 Reply Last reply
      0
      • M meeram395

        Not very clear on what you want. So if one node is expanded already and if you try to expand another node, then do you require all the remaining open nodes should be collapsed or it should remain open?

        Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

        R Offline
        R Offline
        Rajesh Kumar Chekuri
        wrote on last edited by
        #3

        yes..... all the remaining open nodes should be collapsed

        Best Regards Rajesh Kumar Chekuri www.rajeshchekuri.co.cc www.funnydotnet.blogspot.com

        D 1 Reply Last reply
        0
        • R Rajesh Kumar Chekuri

          hi........ we are working on tree view but the problem is tree view is expands every node but i want only one node expands every time, mean if already one node is expanded then we try to expand another then automatically other nodes are collapsed .. Waiting for Response ..............

          Best Regards Rajesh Kumar Chekuri www.rajeshchekuri.co.cc www.funnydotnet.blogspot.com

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          So capture the open event, and close all the other nodes in code.

          Christian Graus Driven to the arms of OSX by Vista.

          1 Reply Last reply
          0
          • R Rajesh Kumar Chekuri

            yes..... all the remaining open nodes should be collapsed

            Best Regards Rajesh Kumar Chekuri www.rajeshchekuri.co.cc www.funnydotnet.blogspot.com

            D Offline
            D Offline
            Dominic Goulet
            wrote on last edited by
            #5

            You could achieve this easily by using the CollapseAll method from the tree view and then, on the clicked node you could do thisNode.Expanded = true, and recursively do this for all the parents he has using the Parent property. For instance,

            youTree.CollapseAll();

            .. on the event

            TreeNode currentNode = nodeFromEvent;
            while(currentNode != null)
            {
            currentNode.Expanded = true;
            currentNode = currentNode.Parent;
            }

            ______________________ Dominic Goulet FroggedSoft My blog

            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