Treeview nodes won't toggle collapse

A

APA

I have a treeview control that is populated from xml from a database which was feed to an XmlDataSource control. Here's my treeview definition


<asp:TreeView ID="trvGallery" runat="server" DataSourceID="xmlDataSrc1" ImageSet="Arrows" OnSelectedNodeChanged="Select_Change">
<DataBindings>
<asp:TreeNodeBinding DataMember="years" ValueField="year" TextField="year" SelectAction="Expand" />
<asp:TreeNodeBinding DataMember="months" ValueField="monthno" TextField="month" SelectAction="Expand" />
<asp:TreeNodeBinding DataMember="gallery" ValueField="galleryid" TextField="galleryname" SelectAction="Select" />
</DataBindings>
</asp:TreeView>


The month and year nodes are not collapsing when I click on them. How do I get them to toggle the collapse/expand state?

The source XML looks like this

<GalleryList>
<years year="2006">
<months month="March" monthno="3">
<gallery galleryid="9" galleryname="gallerymarch012006" />
</months>
<months month="June" monthno="6">
<gallery galleryid="1" galleryname="gallery01june2006" />
<gallery galleryid="2" galleryname="gallery02june2006" />
</months>
<months month="September" monthno="9">
<gallery galleryid="10" galleryname="gallery01september2006" />
</months>
</years>
<years year="2007">
<months month="July" monthno="7">
<gallery galleryid="3" galleryname="gallery01july2007" />
</months>
</years>
</GalleryList>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top