Hi,
i'm using the UltraWebTree Component (V. 9.1) with these Properties:
<ignav:UltraWebTree ID="wtLog" runat="server" OnDemandLoad="wtLog_DemandLoad" LoadOnDemand="ManualSmartCallbacks" Height="297px" Indentation="20" TargetUrl="" ImageDirectory="~/images/infragistics/" EnableViewState="true" Width="163px" WebTreeTarget="ClassicTree" ExpandAnimation="None" onnodeclicked="wtLog_NodeClicked" ExpandOnClick="True"> <ClientSideEvents NodeClick="wtLog_NodeClick" /> </ignav:UltraWebTree>
But when i perform any postback, all Nodes become collapsed.
On Page_Load i add some root nodes if !PostBack. OnDemandLoad i add folder nodes / file nodes.
Node newNode = new Node() { Text = GetShortLogFileName(file.Name), ShowExpand = false, DataPath = file.FullName, ToolTip = file.Name, Tag = "file", ImageUrl = "~/images/730-list.gif" };nodes.Add(newNode);
via client side event wtLog_NodeClick i stop the node-click-postbacks when tag != "file"
<script type="text/javascript"> function wtLog_NodeClick(treeId, nodeId, button) { var tree1 = igtree_getTreeById(treeId); var Nodeclick = igtree_getNodeById(nodeId); if (Nodeclick.getTag() != "file") { tree1.CancelPostBack = true; } }</script>
But the only thing what happen, when i click on a file node is: Page_Load, Page_Unload
wtLog_NodeClicked will not be called. And all nodes are gone after this postback.
Alle nodes are also gone, when i perform a postback via an other control e.g. a button.
please help me with this issue.
regards.
Hello,
This article details the problem and explains what you are experiencing.
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=9685
This is a known issue, unfortunately and the tree is designed to no maintain state in case of async postbacks. There are two approaches I would recommend:
1. Make the page non-postbackable, meaning the user can only navigate away from is to a different section of the site, and any page related operations are done via AJAX only, no fully page post back.
2. Maintain the tree state yourself using a hidden field and take into account node expansions by the user. Once there is a postback you can bring the tree back to the state using either the server or the client API.
-Taz.