I have several RadTreeViews, some whose nodes are static and some whose nodes use TreeNodeExpandNode.WebService to load the nodes on demand. The number of TreeViews is dynamic, and thus I need to build them from scratch in codebehind (RadTreeview tree1 = new RadTreeview()).
My page has a Submit button which causes a postback. Since my trees are dynamic, I am forced to rebuild them for each postback.
The problem is with the node state. On the first postback and subsequent tree rebuilds, the tree is displayed as the user left it (expanded nodes, checked nodes, and all). But if the user submits again, causing a second postback, the tree is collapsed and, if the nodes selected are from a subnode of one using the web service, those checked are not remembered.
Is there something I can do to (a) prevent the trees from collapsing and (b) rememeber all nodes that were checked prior to the postback, no matter how many subsequent postbacks occur?
<
telerik:RadDatePicker
runat
=
"server"
Skin
=
"Windows7"
/><
br
>
<
telerik:RadAjaxLoadingPanel
runat
=
"server"
Skin
=
"Windows7"
/><
br
>
<
telerik:RadGrid
runat
=
"server"
Skin
=
"Windows7"
><
br
>
<
PagerStyle
PagerTextFormat
=
"{4} {5} Matches Found • Displaying Items {2} to {3} on Page {0} of {1}."
/><
br
>
</
telerik:RadGrid
><
br
>
<
telerik:RadComboBox
runat
=
"server"
Skin
=
"Windows7"
/>
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Timestamp: Mon, 10 Oct 2011 16:11:46 UTC
Message: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '�'.
Line: 6
Char: 84093
Code: 0
URI: http://[website url removed]/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_scriptManager_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3ae71d0a15-7471-4384-9905-78bdf2047cba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2011.1.413.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3abd09f19b-b595-4ea4-8ab8-449a745bc83c%3a16e4e7cd%3aed16cbdc%3af7645509%3a24ee1bba%3af46195d3%3a19620875%3a874f8ea2%3a490a9d4e%3abd8f85e4%3ae330518b%3a1e771326%3ac8618e41%3aaa288e2d%3a3f6e8f3f%3a8e6f0d33%3a6a6d718d
No code changes have been made to the page and it was working fine under .Net 3.5. We are on version 2011.1.413.35 of the Telerik controls.
EDIT:
I tried serveral different things to get this to work with little success. As a last attempt I upgraded to the latest version of the Telerik controls, 2011.2.915.40. When I upgraded I noticed that it was referencing the 3.5 framework version of the dll instead of the 4.0 version. I manually changed this and retested - it now works again. Unfortunately, I have to regression test my site due to the Telerik upgrade but we are already in the process of doing this with the 4.0 migration, so it could be worse.