Home All Groups Group Topic Archive Search About

Tree view with XML and Populateondemand

Author
30 Sep 2006 7:31 AM
Nishad
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>

Author
3 Oct 2006 8:11 AM
Patrick.O.Ige
http://www.15seconds.com/issue/041117.htm
http://beta.asp.net/QUICKSTART/aspnet/doc/ctrlref/navigation/treeview.aspx
Patrick

Show quoteHide quote
"Nishad" <psnis***@gmail.com> wrote in message
news:1159601487.146098.256150@e3g2000cwe.googlegroups.com...
> 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>
>