Groups | Blog | Home
all groups > asp.net webcontrols > september 2006 >

asp.net webcontrols : Tree view with XML and Populateondemand



Nishad
9/30/2006 12:31:27 AM
Dear All,
I have a tree view control bound to xml file and I am using
XMLDataSource comntrol connect to XML file. I set the Populateondemand
property of the Tree View control to True. But I think the XML file is
taken fully at the first loading.

I have'nt writen any code in the populateondemand event handler.
I dont know if it needs some code.

Actually I want to get data of the xml parts by parts as needed.

If any one knows how to use xml with tree view with populate on demad

Hope your help.

Thnak you all.

Below is my code
=======================================================================

<asp:TreeView ID="trvDirectory" runat="server"
DataSourceID="XmlDataSource1" ExpandDepth="1"
Font-Bold="False" ForeColor="#0066CC" ImageSet="Simple"
NodeIndent="15" ShowLines="True"
Target="fmeDetails" Font-Underline="False">
<ParentNodeStyle Font-Bold="True" />
<HoverNodeStyle BorderColor="#0066CC" BorderWidth="1px"
Font-Bold="True" Font-Underline="False" />
<SelectedNodeStyle Font-Underline="True"
HorizontalPadding="0px" VerticalPadding="0px" />
<NodeStyle Font-Names="Tahoma" Font-Size="10pt"
HorizontalPadding="10px" NodeSpacing="0px"
VerticalPadding="0px" Font-Bold="True" />
<DataBindings>
<asp:TreeNodeBinding DataMember="folder"
ImageToolTipField="dr_Remark"
ImageUrl="~/Images/Msc/Folder-closed16.gif"
NavigateUrlField="dr_DtlsUrl" TextField="dr_Name"
ToolTipField="dr_Remark" />
<asp:TreeNodeBinding DataMember="directory"
SelectAction="Expand" Text="Directory"
Value="Directory" />
</DataBindings>
<LeafNodeStyle Font-Bold="False" />
</asp:TreeView>
<asp:XmlDataSource ID="XmlDataSource1" runat="server"
DataFile="~/App_Data/XML/Directory/DirectoryFolderTree.xml"
EnableCaching="False"></asp:XmlDataSource>
Patrick.O.Ige
10/3/2006 12:00:00 AM
http://www.15seconds.com/issue/041117.htm
http://beta.asp.net/QUICKSTART/aspnet/doc/ctrlref/navigation/treeview.aspx
Patrick

[quoted text, click to view]

AddThis Social Bookmark Button