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. Add scrollbar to listbox/Treeview after specific height.

Add scrollbar to listbox/Treeview after specific height.

Scheduled Pinned Locked Moved ASP.NET
csharpasp-net
6 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.
  • Q Offline
    Q Offline
    Qasim1984
    wrote on last edited by
    #1

    Dear Experts I am working on a page in asp.net I want to add scrollbar to listbox/treeview controls after specific hieght. Initialy its height should be equal to its contents (items). When new item is added its height should increase to its contents (items). When hieght is equal to or greater than 400px then a scrollbar should be shown. Then main issues are 1. Initially the height should be equal to its contents. 2. When new items/nodes are added to listbox/treeview its height should increase to its contents. 3. When I expand/collapse a node, its height should change to fit the contents 4. When height is >=400px then scrollbar should be shown. Thanks in advance

    S S 2 Replies Last reply
    0
    • Q Qasim1984

      Dear Experts I am working on a page in asp.net I want to add scrollbar to listbox/treeview controls after specific hieght. Initialy its height should be equal to its contents (items). When new item is added its height should increase to its contents (items). When hieght is equal to or greater than 400px then a scrollbar should be shown. Then main issues are 1. Initially the height should be equal to its contents. 2. When new items/nodes are added to listbox/treeview its height should increase to its contents. 3. When I expand/collapse a node, its height should change to fit the contents 4. When height is >=400px then scrollbar should be shown. Thanks in advance

      S Offline
      S Offline
      sashidhar
      wrote on last edited by
      #2

      List box doesnt support scrollbar directly we need to add to div as shown in the following article..! Finally a Horizontal Scroll Bar List Box in ASP.NET![^]

      LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.

      Q 1 Reply Last reply
      0
      • S sashidhar

        List box doesnt support scrollbar directly we need to add to div as shown in the following article..! Finally a Horizontal Scroll Bar List Box in ASP.NET![^]

        LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.

        Q Offline
        Q Offline
        Qasim1984
        wrote on last edited by
        #3

        I have already read this article. It does not work in my scenario. I have a listbox control for sections at left side of my web page. below it I have a treeview control for questions. When I select section from listbox its shows questions in treeview. Currently the height of both control is 400px and it shows scrollbar properly. When I have few items in listbox/treeview. Its height looks very awkward. I want height of these control to fits its contents intially. When new item is inserted/deleted/expanded/collasped its height should change to fit its contents. when its height increased to 400px then scrollbar shouold appear.

        1 Reply Last reply
        0
        • Q Qasim1984

          Dear Experts I am working on a page in asp.net I want to add scrollbar to listbox/treeview controls after specific hieght. Initialy its height should be equal to its contents (items). When new item is added its height should increase to its contents (items). When hieght is equal to or greater than 400px then a scrollbar should be shown. Then main issues are 1. Initially the height should be equal to its contents. 2. When new items/nodes are added to listbox/treeview its height should increase to its contents. 3. When I expand/collapse a node, its height should change to fit the contents 4. When height is >=400px then scrollbar should be shown. Thanks in advance

          S Offline
          S Offline
          Sneha Bisht
          wrote on last edited by
          #4

          try with panel, i think this help ;

          Q 1 Reply Last reply
          0
          • S Sneha Bisht

            try with panel, i think this help ;

            Q Offline
            Q Offline
            Qasim1984
            wrote on last edited by
            #5

            I have added panel for each control (listbox, treeview). This panel occupy the space of 400px. treeview is far away from listbox.

            R 1 Reply Last reply
            0
            • Q Qasim1984

              I have added panel for each control (listbox, treeview). This panel occupy the space of 400px. treeview is far away from listbox.

              R Offline
              R Offline
              Ravindra Nidhonkar
              wrote on last edited by
              #6

              Add follwoing style to get scroll bar:

              style="overflow: auto"

              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