I have implemented the java script in the knowledge base to check all child nodes when the parent is checked. This works fine.
However when I try to either click a button/postback, the checked boxes get unchecked. This presents a problem because I need to know what the state of the check boxes are in so I can run something based on what's checked. I've also been able to write the recursive method (CheckAll) in the .cs code to check the child boxes but again, whenever the page reloads I can't check to see if a nodes is checked because it becomes unchecked. Hopefully I am just missing something simple but I can't figure it out.
what i want to do is something like
if (isPostBack)
{
if (webtree.Nodes[i] .Checked ==true)
{ do something}
}
or
protected void Button click (object sender, EventArgs e)
HI,
Check the EnabledViewState property of your WebTree - make sure it is set to true.
Are you using LoadOnDemand?
My tree is loaded from a database source. The only LoadOnDemand settings that work right are manual and notset. Ironically, I did find a workable solution by setting EnabledViewState to false. This for some reason keeps the checkboxes checked when I click the button and re-load the page. It only keeps them checked once though, if I click the button a second time the checks go away unless I re-check the boxes. However the current solution is sufficent. It would be nice though to keep the boxes checked at all times but I still haven't found anything yet.