?
Solved

How to make webcontrols.treeView Return Automatically to the node checked after an  event

Posted on 2009-02-11
5
Medium Priority
?
242 Views
Last Modified: 2012-05-06
I've got a treeview webcontrol on a webpage with a long list of items.  When a user clicks on an item it places an image icon next to that item.  It does this after posting back to the server because of the selectedNodeChange event and getting the image icon.   However, the treeview then scrolls back automatically to the top of the tree instead of staying put where the user clicked on the node.   So then the user has to scroll all the way back down to where they left off.  

My question is:   how can I keep the treeview scrolled down to the where the last node was clicked on by the user after the postback?   I thought this was automatic but it is not.

Thanks in advance.
0
Comment
Question by:jonmclean2
  • 3
5 Comments
 
LVL 15

Accepted Solution

by:
Praveen Venu earned 2000 total points
ID: 23619787
The solution was to delete SmartNavigation="true"  from the page directive (first line of the ASPX page) and add  add
 MaintainScrollPositionOnPostback="true"
0
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 23620039
0
 
LVL 1

Author Comment

by:jonmclean2
ID: 23622518
Praveenvenu,

Well, that didn't work.  MaintainScrollPositionOnPostback only works for an entire page view but it has no effect on a treeview that is inside of a panel.   Close but no cigar.    :)
0
 
LVL 1

Author Comment

by:jonmclean2
ID: 23623136
Hi Ragi0017,

I think those instructions only work on a windows treeview control but not on a web treeview control.  Those methods were not available on the web control is what I meant to say.
0
 
LVL 1

Author Closing Comment

by:jonmclean2
ID: 31546255
Actually, I decided to remove my treeview from the panel and place it directly on the page just so I could use the instruction you gave me.  It was a heck of a lot easier to redesign the page around this change than trying to keep it in the panel.   So I thank you very much!!!
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Screencast - Getting to Know the Pipeline

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question