Treeview state in a master page

V

Vikram

Hi,
I am using a treeview control in a master page. On click of any node I am
opening new page and all pages are incorporated in master page. Now I want to
maintain state of treeview expanded nodes. i.e. if any node is expanded, then
on click of that node and after new page is loaded , treeview should come
with the previous state i.e. nodes should come expanded if they were and
collapsed if they were. How to do this as clciking on node and loading new
page gives ispostback to false for the treeview container control?

Vikram
 
Z

ZZ_Scarab

Hi Andrew,

I had the same problem and found your reply to be very informative. Thank
you very much.

I do have another related problem, though, and being new to C# and ASP.Net,
I'm not sure if I'm missing something real basic.

I implemented a solution based on your suggestion and it worked fine.
However, I need to bind the treeview to a datasource. I'm for now trying a
WebSiteMap file. As soon as I set the treeview's DataSourceId to a data
source based on the file, the TreeViewMain_SelectedNodeChanged even stops
firing. Setting a breakpoint on the line

if (TreeViewMain.SelectedNode.Value != string.Empty)

is never "hit". Is this a feature of the treeview control or am I missing
something?

Can you shed ome light on this please as it's really driving me nuts!

Thanks
 
Z

ZZ_Scarab

Hi,

More comment: I changed my data source from the Sitemap to programmatically
populating the tree view from a database. The problem went away and the even
is now firing. That was the only change, so I'm still not sure I understand
why it was not firing before.

--------------------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top