Hi Customer,
Thanks for contacting Syncfusion.
To view the selected node in
TreeView when page loads, we suggest you to set the EnsureVisibleItem as true
in Page_Load method and also set selected as true in which node you want to
visible when page loads. The EnsureVisibleItem method is used to ensure that
the selected item is visible. After the page is loaded, TreeView root html
control will be scrolled automatically and selected item would be visible.
Please refer the following code snippet.
<code>
[.cs]
protected void
Page_Load(object sender, EventArgs e)
{
this.TreeView.EnsureVisibleItem(true);
}
[.aspx]
<syncfusion:TreeView ID="TreeView" runat="server" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" Height="80px" Width="160px">
<Items>
<syncfusion:TreeViewNode Expanded="true" Text="Node1" Selected="true" >
<syncfusion:TreeViewNode Text="Child
Node1">
</syncfusion:TreeViewNode>
</syncfusion:TreeViewNode>
</Items>
</syncfusion:TreeView>
</code>
If you want to know more details
about Tree View. Please refer the following link.
http://help.syncfusion.com/ug/asp.net/tools/default.htm#!documents/nodesvisibility.htm
We have also prepared a simple sample to exhibit the
behavior. Please follow the below link.
TreeView_Expand.zip
Please let us know if you have further queries.
Warm Regards,
Gurunathan A