Treeview nodes won't toggle collapse



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">
<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" />

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

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


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