Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Save treeview viewstate and reload it after the treeview is rebuilt

Posted on 2004-09-13
5
617 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 250 total points
ID: 12044569
try this:

Protected Overrides Function SaveViewState() As Object

Viewstate("TreeView1") = Me.TreeView1

Return MyBase.SaveViewState()

0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12044586
0
 
LVL 10

Assisted Solution

by:jnhorst
jnhorst earned 250 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
EF5: Question about Metadata Artifact Processing 4 21
List<PaisEntity> - show some 1 28
edit .asp files 5 30
IEnumerable<T> to a List<T> 8 37
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

808 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