Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Treeview state in a master page

Reply
Thread Tools

Treeview state in a master page

 
 
Vikram
Guest
Posts: n/a
 
      08-22-2007
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
 
Reply With Quote
 
 
 
 
Andrew Robinson
Guest
Posts: n/a
 
      08-29-2007
Vikram,

Take a look at my blog. I have a pretty extensive discussion on your issue.

http://blog.binaryocean.com/2006/01/...teCSAndVB.aspx

Hope this gets you going in the right direction.

--

Andrew Robinson
http://blog.binaryocean.com
http://www.bellinghamdotnet.org


"Vikram" <> wrote in message
news:81069134-2CD2-42ED-ACEE-...
> 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



 
Reply With Quote
 
 
 
 
ZZ_Scarab
Guest
Posts: n/a
 
      09-10-2007
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



"Andrew Robinson" wrote:

> Vikram,
>
> Take a look at my blog. I have a pretty extensive discussion on your issue.
>
> http://blog.binaryocean.com/2006/01/...teCSAndVB.aspx
>
> Hope this gets you going in the right direction.
>
> --
>
> Andrew Robinson
> http://blog.binaryocean.com
> http://www.bellinghamdotnet.org
>
>
> "Vikram" <> wrote in message
> news:81069134-2CD2-42ED-ACEE-...
> > 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

>
>
>

 
Reply With Quote
 
ZZ_Scarab
Guest
Posts: n/a
 
      09-12-2007
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.

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

"ZZ_Scarab" wrote:

> 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
>
>
>
> "Andrew Robinson" wrote:
>
> > Vikram,
> >
> > Take a look at my blog. I have a pretty extensive discussion on your issue.
> >
> > http://blog.binaryocean.com/2006/01/...teCSAndVB.aspx
> >
> > Hope this gets you going in the right direction.
> >
> > --
> >
> > Andrew Robinson
> > http://blog.binaryocean.com
> > http://www.bellinghamdotnet.org
> >
> >
> > "Vikram" <> wrote in message
> > news:81069134-2CD2-42ED-ACEE-...
> > > 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

> >
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
treeview in master page loses state when new page is selected =?Utf-8?B?QnJpYW4=?= ASP .Net 1 10-31-2007 04:21 PM
Persisting ASP.NET 2.0 Treeview Controls' State within a Master Page Nikron ASP .Net Web Controls 1 09-28-2007 09:19 AM
Persisting ASP.NET 2.0 Treeview Controls' State within a Master Page Nikron ASP .Net 1 09-28-2007 09:19 AM
Treeview - maintaining state with Master-detail pages Greg ASP .Net Web Controls 0 03-27-2006 03:37 PM
seeking servlet "Master" keep getting "Master/servlet/Master" not found. Tomcat 5.0.25 Doug McCann Java 1 08-05-2004 09:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57