Hi all,
I'm using RadTreeView1.GetXml to save the state of my TreeView and repopulate it after postbacks.
I've done a test by replaceing text in a node, and based on that I can tell that saving and repopulating the TreeView is working fine.
The problem is that when I contract some of the nodes, then select(Click on) a node, there is a posteback, and all the nodes are revertted to thier expanded state again.
Expanding and contracting nodes seems to be happening on the client side, as there is no postback when this happens.
The postback dose happen when I click on a spesific node, that is when I use GetXml to save the state, but it dose not seem to be saving the updated state on the nodes.
Here is the code, Please let me know what I am missing here.
and server side
I'm using RadTreeView1.GetXml to save the state of my TreeView and repopulate it after postbacks.
I've done a test by replaceing text in a node, and based on that I can tell that saving and repopulating the TreeView is working fine.
The problem is that when I contract some of the nodes, then select(Click on) a node, there is a posteback, and all the nodes are revertted to thier expanded state again.
Expanding and contracting nodes seems to be happening on the client side, as there is no postback when this happens.
The postback dose happen when I click on a spesific node, that is when I use GetXml to save the state, but it dose not seem to be saving the updated state on the nodes.
Here is the code, Please let me know what I am missing here.
<telerik:RadTreeView ID="RadTreeView1" Runat="server" OnNodeClick="RadTreeView1_NodeClick" EnableDragAndDrop="True" Skin="Vista" OnContextMenuItemClick="RadTreeView1_ContextMenuItemClick" OnNodeEdit="RadTreeView1_NodeEdit" OnNodeDrop="RadTreeView1_HandleDrop" SingleExpandPath="True" EnableViewState="true" > <ContextMenus> <telerik:RadTreeViewContextMenu ID="RightClick" runat="server"> <Items> <telerik:RadMenuItem Value="NewParentNode" Text="Create New Parent Folder" > </telerik:RadMenuItem> <telerik:RadMenuItem Value="NewNode" Text="Create New Folder" > </telerik:RadMenuItem> <telerik:RadMenuItem IsSeparator="true"> </telerik:RadMenuItem> <telerik:RadMenuItem Value="NewVirtualDocument" Text="New Virtual Document" > </telerik:RadMenuItem> <telerik:RadMenuItem Value="UploadPDF" Text="Upload PDF" > </telerik:RadMenuItem> <telerik:RadMenuItem IsSeparator="true"> </telerik:RadMenuItem> <telerik:RadMenuItem Value="DeleteNode" Text="Delete Folder" > </telerik:RadMenuItem> </Items> <CollapseAnimation Type="none" /> </telerik:RadTreeViewContextMenu> </ContextMenus></telerik:RadTreeView>protected void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs NodeEvent){ clickedNode = NodeEvent.Node; ViewState["ClickedNode"] = clickedNode.Value.ToString(); createDynamicTable(Convert.ToInt32(ViewState["ClickedNode"].ToString())); string savetreeViewState = RadTreeView1.GetXml(); savetreeViewState = savetreeViewState.Replace("South Africa", "save state is working"); Session["myTreeView"] = savetreeViewState;}
Thank you for your time.