DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
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:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us