Add scrollbar to listbox/Treeview after specific height.
-
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
-
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
-
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.
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.
-
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
try with panel, i think this help ;
-
try with panel, i think this help ;
-
I have added panel for each control (listbox, treeview). This panel occupy the space of 400px. treeview is far away from listbox.
Add follwoing style to get scroll bar:
style="overflow: auto"