Welcome Guest Search | Active Topics | Sign In | Register

Expand TreeView fully by default? Options
Dynamic Web
Posted: Monday, October 22, 2007 8:25:31 PM
Rank: Member
Groups: Member

Joined: 10/22/2007
Posts: 18
Is there any way to have a treeview show as fully expanded when it first appears? Seems like all examples show expansion on click only.
eo_support
Posted: Monday, October 22, 2007 8:37:28 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You need to explicitly call ExpandAll method on each of the top level node.

Thanks
Dynamic Web
Posted: Monday, October 22, 2007 8:48:24 PM
Rank: Member
Groups: Member

Joined: 10/22/2007
Posts: 18
Got it. Here is the code that I tried just after the databind in Page_Load() that seems to work well:

Code: C#
foreach (EO.Web.TreeNode node in TreeView1.Nodes)
{
     if (node.IsTopLevel) node.ExpandAll();
}


Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.