[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6307
  • 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
 
Sammy AgeilCommented:
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
 
Sammy AgeilCommented:
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

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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