This is a migrated thread and some comments may be shown as answers.

node checkbox and postback

4 Answers 86 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Benjamin
Top achievements
Rank 1
Benjamin asked on 09 Oct 2009, 02:54 AM
hello,

how to keep the checked status of node's checkboxes after a postback?

thanks

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Oct 2009, 04:48 AM
Hello Benjamin,

Checkout the code library which might help in persisting the checkbox state after postback.
Persist Checked State after PostBack

-Shinu.
0
Vesko
Top achievements
Rank 2
answered on 12 Oct 2009, 09:06 AM
The Checked status IS persisted after a postback.

What is your exact scenario?
0
Accepted
Jimmy
Top achievements
Rank 1
answered on 13 Jan 2010, 12:43 PM
Hi,

If anyone else run into problems with nodes not being checked after post back, then make sure nodes are added during OnInit, not CreateChildControls, which seems to be too late in this case.
0
Wyatt
Top achievements
Rank 1
answered on 07 May 2010, 02:16 PM
Tree.EnableViewState = False 

I am partially populating a load-on-demand tree that is toggled to be visible and hidden via AJAX.  I perform the partial population in CreateChildControls.  On the initial page load the tree is not visible (which is by design) --> AJAX toggle: it's visible and checked (good) --> AJAX toggle: it's hidden (good) --> AJAX toggle: it's visible but not checked (bad).  I have the same problem when I populate the tree in OnInit.  I fixed the problem by setting the tree's EnableViewState property to False, which I probably would have done while optimizing the code anyway.

Hope this helps someone.

 

Tags
TreeView
Asked by
Benjamin
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Vesko
Top achievements
Rank 2
Jimmy
Top achievements
Rank 1
Wyatt
Top achievements
Rank 1
Share this question
or