Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Save treeview viewstate and reload it after the treeview is rebuilt

Posted on 2004-09-13
5
Medium Priority
?
624 Views
Last Modified: 2008-02-01
Hi Experts,

I use a treeview to display paths.
When user clicks a button, the treeview displays other paths from another datasource.
After that, the user can go back to the previous treeview, but if I reload it, the treeview is the same as first load : I mean the selected and expanded nodes are not the same as the user defined them previously.
That's why I want to know if it's possible to save the viewstate before the user changes my treeview and to reload this viewstate after I rebuilt the treeview.

Hope it's clear.
Thanks in advance for your answers.
0
Comment
Question by:noulouk
  • 3
5 Comments
 
LVL 17

Accepted Solution

by:
AerosSaga earned 1000 total points
ID: 12044569
try this:

Protected Overrides Function SaveViewState() As Object

Viewstate("TreeView1") = Me.TreeView1

Return MyBase.SaveViewState()

0
 
LVL 10

Assisted Solution

by:jnhorst
jnhorst earned 1000 total points
ID: 12046954
If you are using a button to send a postback that goes from one tree display to another, and you want to go back to the previous display, in that button's click event, save info about the selected node in the button's CommandArgument property.  When you reload the tree, you can use that info to select the node.  The info should be accessible in

Request.Form("__EVENTARGUMENT")

John
0
 
LVL 9

Author Comment

by:noulouk
ID: 12048315
I choose a different way to do what I want, but I think your answers are both available.
Thank you for your help.
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12048338
your very welcome
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

971 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