Home All Groups Group Topic Archive Search About

Re: Treeview state in a master page

Author
10 Sep 2007 9:58 PM
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



Show quote
"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/19/SaveTreeViewNodesExpansionCollapseStateCSAndVB.aspx
>
> Hope this gets you going in the right direction.
>
> --
>
> Andrew Robinson
> http://blog.binaryocean.com
> http://www.bellinghamdotnet.org
>
>
> "Vikram" <Vik***@discussions.microsoft.com> wrote in message
> news:81069134-2CD2-42ED-ACEE-2E212B540345@microsoft.com...
> > 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
>
>
>

Author
12 Sep 2007 10:10 PM
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.
--------------------------------------------------------------------------------

Show quote
"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/19/SaveTreeViewNodesExpansionCollapseStateCSAndVB.aspx
> >
> > Hope this gets you going in the right direction.
> >
> > --
> >
> > Andrew Robinson
> > http://blog.binaryocean.com
> > http://www.bellinghamdotnet.org
> >
> >
> > "Vikram" <Vik***@discussions.microsoft.com> wrote in message
> > news:81069134-2CD2-42ED-ACEE-2E212B540345@microsoft.com...
> > > 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
> >
> >
> >

AddThis Social Bookmark Button