|
|
|
start date: Tue, 14 Aug 2007 01:30:01 -0700,
posted on: microsoft.public.dotnet.framework.aspnet.webcontrols
back
| Thread Index |
|
1
Vikram
|
|
2
Antoine Griffard
|
|
3
Ladislav Mrnka
|
Treeview selected Node
Hi,
I am using Asp.net 2.0 treeview control.Tree is having 2-3 level of
hirearechy. I want to show current selected node as expanded when the page
reloads or postback. How can I do that?
Thanks
Date:Tue, 14 Aug 2007 01:30:01 -0700
Author:
|
Re: Treeview selected Node
Hi,
Try this :
protected void tv_PreRender(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (tv.SelectedNode != null)
tv.SelectedNode.Expand();
}
}
Tonio - MVP,
http://www.wygwam.com
http://blogs.developpeur.org/tonio
Date:Tue, 14 Aug 2007 08:57:27 +0000 (UTC)
Author:
|
RE: Treeview selected Node
Hi Vikram,
try to set SelectAction in your nodes to Expand. Be aware of impact on
TreeView functionality. Changing SelectAction can affect which events are
fired when user click on node. For expand mode it will not fire
SelectedNodeChanged any more.
You can also handle SelectedNodeChanged, collapse all nodes and then expand
only selected node if you want to.
Regards,
Ladislav
"Vikram" wrote:
> Hi,
>
> I am using Asp.net 2.0 treeview control.Tree is having 2-3 level of
> hirearechy. I want to show current selected node as expanded when the page
> reloads or postback. How can I do that?
>
> Thanks
>
Date:Tue, 14 Aug 2007 02:26:06 -0700
Author:
|
|
|