• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6427
  • Last Modified:

How to programatically set scrollbar position for treeview

Hello,

I am using an ASP.Net 2.0 treeview. A node in the treevieview is being expanded programatically using the node.expand() method. This all works, however, currently I have to scroll down to see the expanded node. My question is, how can I programatically have the scrollbar position itself to show the expanded node.

myNode1 = New TreeNode()
                myNode1 = tvSMQs.FindNode("myRootNode/version7/1002/4586")
                myNode1.Expand()

Thanks
0
MAIGUI
Asked:
MAIGUI
  • 2
  • 2
1 Solution
 
SammyCommented:
Not sure if this would help or not but its worth a shot
try placing MaintainScrollPositionOnPostback="true" in your aspx page directive
if that doesnt work try the script posted on here
http://forums.asp.net/p/1064579/1539255.aspx
0
 
MAIGUIAuthor Commented:
Hello sammy1971,

Thank you for your reply. Unfortunatly, MaintainScrollPosition will not work for me since, I am expanding the node programatically.

Here is  how the app is working, page loads (therefore scroll position is at the top of the page), then I programatically call the expand method of a node toward the bottom of the page. MaintainScrollPosition would maintain the previous scroll position at the top of the page.

What I need through is a way to move the scroll position to the expanded node.

Thanks
0
 
SammyCommented:
You should read the link I posted
it has a clientscript which should work for you
The script posted by the_lorax
0
 
MAIGUIAuthor Commented:
I will try that out. Can you tell me how I can get the client id of a given tree node though? I will need to get this and pass it to the client script in order to try it out. Thanks
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now