473,545 Members | 1,471 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to maintain state of a TreeView control

I have a TreeView control with EnableViewState = True; however, the TreeView
does not maintain its previous state on postback. Is there something else
that needs to be set up?

Thanks,

Keith
May 10 '06 #1
1 1399
Are you repopulating or rebinding (however you handle it) on every
post? I.e. in the form load event, ?

if so, make sure to check for IsPostBack (in form load) and only bind
the Tv when IsPostBack=fals e.

-Rick

May 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3453
by: | last post by:
This is a very open ended question. I have an app with a page that uses link buttons to change the display. On the prior page you have a list of objects. You click one of those objects to see it's details. I have nav Link buttons that allow you to go to previous or next object from the object list on previous page. In the command event of the...
1
6144
by: R. Sammut | last post by:
Hi, I have a treeview control that is updated every 30 seconds. The treeview nodes are cleared and new nodes (same number of nodes and hierarchy) are added to the treeview. Now I need to save the state of the expanded treeview so that I can apply the same expanded state to the updated treeview. is there something i can do?
0
1417
by: Edwin Knoppert | last post by:
I'm using a simple treeview for helpsystem. The treeview is on a masterpage, right beside it it has the container. The user uses the treeview to navigate to helppages using this masterpage. But on each page load the treeview nodes are collapsed to original state. 1) I want to maintain the nodes expanded state. 2) I would like to select the...
7
10340
by: Andrew Robinson | last post by:
I have a treeview control that I use as a menu & navigation control within a master page. The nodes for this control are loaded from a database which contains the text and url of each like and the hierarchy of the menu tree. All pretty normal stuff. Is there any simple method of maintaining the expanded / collapsed state of each node as my...
1
2102
by: keithb | last post by:
Can someone provide general information on how to maintain state for a treeview control. Specifically, I need the application to maintain node expansion across postbacks. Thanks, Keith
2
1355
by: jeff_m | last post by:
Hello, I'm having some trouble with a combination of these elements: the Session state, a Repeater control, a TreeView control, and a button. Here's the process: - User logs in (loginid stored in session state) - User presses a button (to delete a node from the TreeView) - I re-bind the TreeView and the Repeater to reflect changes made...
2
2302
by: Peter Afonin | last post by:
Hello, I've created a web application using Visual Studio 2005. I have a treeview control there. When the user expands it and clicks on the link, the treeview collapses automatically. Is it possible to keep it expanded to the level the user expanded it? In other words, to keep the state of the treeview control between postbacks? Of...
0
1183
by: Mel | last post by:
I fluent in Visual Basic programming Windows applications but I am a brand new user to ASP.NET (I'm on my 3rd day now, woo hoo!). I was wondering if there is a way to remember the last state of the treeview control between pages. For example, when I first open the treeview page I navigate the tree to the area I am interested in, then when I...
1
3583
by: Nikron | last post by:
Hi, I'm having an issue with the ASP.NET 2.0 Treeview control and persisting its' state accross requests. My Control is embedded within a master page and is used for site navigation. My problem is that the user wants to know which page they are currently on and therefore I need to highlight the selected node. The problem is I lose state...
0
7465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7398
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7416
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7752
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5325
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3449
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
701
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.