Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Save treeview viewstate and reload it after the treeview is rebuilt

Posted on 2004-09-13
5
Medium Priority
?
622 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
[X]
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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

730 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