views:

236

answers:

1

I have a treeview in my .aspx:

<asp:TreeView ID="tvDocCatAndType" runat="server" />

Not much else going on in the page -- two <asp:LinkButtons> and one <asp:Label>; the page is a child of a master page, so these controls are within a <asp:Content> control. I populate the treeview in code -- just 3 node levels, including the root node. All nodes have checkboxes, and I initialize all node.Checked to true. I have some Javascript to do the usual check/uncheck up and down the tree as parent and child node checkboxes are toggled.

No matter how many checkboxes I clear in the UI, on postback every single node has node.Checked = true regardless of the state of the checkbox in the UI.

This is not the first time I've used a treeview, but I've never had this problem before. I created this page by light adaptation of an earlier project that works fine. Thanks in advance for any helpful comments or questions,

Chris

A: 

Was poking around in the wrong place... the code to populate the treeview and the code to process the checked nodes was just fine. My error was in Page_Load, where I was unconditionally calling the populate routine, so I was always resetting the treeview to the all-checked state on postback before the code to examine the checked nodes was being executed. Duh!

GISmatters