jonmclean2
asked on
How to make webcontrols.treeView Return Automatically to the node checked after an event
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://msdn.microsoft.com/en-us/library/system.windows.forms.treenode.ensurevisible.aspx
ASKER
Praveenvenu,
Well, that didn't work. MaintainScrollPositionOnPo stback 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. :)
Well, that didn't work. MaintainScrollPositionOnPo
ASKER
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.
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.
ASKER
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!!!