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. General Programming
  3. C#
  4. Last node is not visible in TreeView because of scroll bar.

Last node is not visible in TreeView because of scroll bar.

Scheduled Pinned Locked Moved C#
helpquestion
8 Posts 5 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.
  • P Offline
    P Offline
    Piyush Vaishnav
    wrote on last edited by
    #1

    I am having treeview with some nodes. If there is no. of node is more than height of treeview then scroll bar is coming. Now the problem is, because of scroll bar i am not able to see the last node. How i can solve this issue? Thanks in advance.

    L A 2 Replies Last reply
    0
    • P Piyush Vaishnav

      I am having treeview with some nodes. If there is no. of node is more than height of treeview then scroll bar is coming. Now the problem is, because of scroll bar i am not able to see the last node. How i can solve this issue? Thanks in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      set property Scrollable to false

      P 1 Reply Last reply
      0
      • L Lost User

        set property Scrollable to false

        P Offline
        P Offline
        Piyush Vaishnav
        wrote on last edited by
        #3

        Scroll bar is required, because there are nodes which is greater the height of TreeView. It should show the last node even scroll bar is there. Am i missing any porperty or Is it microsoft fault.

        1 Reply Last reply
        0
        • P Piyush Vaishnav

          I am having treeview with some nodes. If there is no. of node is more than height of treeview then scroll bar is coming. Now the problem is, because of scroll bar i am not able to see the last node. How i can solve this issue? Thanks in advance.

          A Offline
          A Offline
          AspDotNetDev
          wrote on last edited by
          #4

          Can you post some example code that demonstrates this? Does it always not display the last node when there is a scroll bar, or is it only if there are a certain minimum number of nodes? Are you using Windows Forms or ASP.net? Can you post a screenshot somewhere and add a link to it from here? I've encountered your issue when adding a bunch of nodes (32,000 or something like that) to a TreeView. There is no way around it that I know of. However, you could put any nodes that would make the TreeView have more than 32,000 nodes into a new TreeView instead... or implement TreeView paging. Or you could allow the user to filter the nodes somehow (if they are alphabetic in nature, you could allow them to show only a letter at a time, for example). You could also disable scrolling on the TreeView itself, but enable scrolling for the container that holds the TreeView. And if you still have the issue, put a control (e.g., a label) at the bottom of the TreeView so that that control gets hidden instead of part of the TreeView. I can assist you further if you provide more information.

          [Forum Guidelines]

          P D 2 Replies Last reply
          0
          • A AspDotNetDev

            Can you post some example code that demonstrates this? Does it always not display the last node when there is a scroll bar, or is it only if there are a certain minimum number of nodes? Are you using Windows Forms or ASP.net? Can you post a screenshot somewhere and add a link to it from here? I've encountered your issue when adding a bunch of nodes (32,000 or something like that) to a TreeView. There is no way around it that I know of. However, you could put any nodes that would make the TreeView have more than 32,000 nodes into a new TreeView instead... or implement TreeView paging. Or you could allow the user to filter the nodes somehow (if they are alphabetic in nature, you could allow them to show only a letter at a time, for example). You could also disable scrolling on the TreeView itself, but enable scrolling for the container that holds the TreeView. And if you still have the issue, put a control (e.g., a label) at the bottom of the TreeView so that that control gets hidden instead of part of the TreeView. I can assist you further if you provide more information.

            [Forum Guidelines]

            P Offline
            P Offline
            Piyush Vaishnav
            wrote on last edited by
            #5

            Thanks for alternative solution. Actually i am using Windows Forms and this problem is also there when scroll bar comes in to picture. Now i am adding one extra node at the last of treeview, so that this extra node will going to be hidden.

            P 1 Reply Last reply
            0
            • P Piyush Vaishnav

              Thanks for alternative solution. Actually i am using Windows Forms and this problem is also there when scroll bar comes in to picture. Now i am adding one extra node at the last of treeview, so that this extra node will going to be hidden.

              P Offline
              P Offline
              Piyush Vaishnav
              wrote on last edited by
              #6

              After adding extra node at the last, we can select last node by key down arrow. How we can disable any particular TreeNode, not complete TreeView in windows form.

              1 Reply Last reply
              0
              • A AspDotNetDev

                Can you post some example code that demonstrates this? Does it always not display the last node when there is a scroll bar, or is it only if there are a certain minimum number of nodes? Are you using Windows Forms or ASP.net? Can you post a screenshot somewhere and add a link to it from here? I've encountered your issue when adding a bunch of nodes (32,000 or something like that) to a TreeView. There is no way around it that I know of. However, you could put any nodes that would make the TreeView have more than 32,000 nodes into a new TreeView instead... or implement TreeView paging. Or you could allow the user to filter the nodes somehow (if they are alphabetic in nature, you could allow them to show only a letter at a time, for example). You could also disable scrolling on the TreeView itself, but enable scrolling for the container that holds the TreeView. And if you still have the issue, put a control (e.g., a label) at the bottom of the TreeView so that that control gets hidden instead of part of the TreeView. I can assist you further if you provide more information.

                [Forum Guidelines]

                D Offline
                D Offline
                daxbakken
                wrote on last edited by
                #7

                This happens in windows forms with only a few nodes. Doesn't have to be 32,000 nodes! THe only work around that I've found is adding a blank node to the end as mentioned elsewhere on this thread. -Dax

                S 1 Reply Last reply
                0
                • D daxbakken

                  This happens in windows forms with only a few nodes. Doesn't have to be 32,000 nodes! THe only work around that I've found is adding a blank node to the end as mentioned elsewhere on this thread. -Dax

                  S Offline
                  S Offline
                  spif2001
                  wrote on last edited by
                  #8

                  I found that adding this line to the forms load event (or where you set the items in the treeview) helps:

                  this.treeView.Height = (this.treeView.Height / this.treeView.ItemHeight) * this.treeView.ItemHeight + 3;

                  I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

                  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