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

Node Populating issue with Webservice method after postback

1 Answer 55 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
mohmedsadiq modan
Top achievements
Rank 1
mohmedsadiq modan asked on 28 Dec 2011, 08:25 AM
Hello,

I have created one page which have Treeview and other controls. Child node data populating using web-service method.

 <ajaxToolkit:ToolkitScriptManager runat="server" ID="RadScriptManager1" AsyncPostBackTimeout="18000">
</ajaxToolkit:ToolkitScriptManager>
<telerik:RadScriptBlock>
<script>
 var allowDragDrop = "<%= allowDragAndDrop%>";
            var SelectedType;
            function nodePopulating(sender, eventArgs) {
                var node = eventArgs.get_node();
                var context = eventArgs.get_context();
                SelectedType = document.getElementById('<%=hdnSelectedNodeType.ClientID %>').value;
                context["ParentID"] = node.get_value();
                context["AllowDragAndDrop"] = allowDragDrop;
                context["SelectedType"] = SelectedType;
            }
        </script>
</telerik:RadScriptBlock>

Treeview is located in one Update panel and Other controls are located in Second Update panel like below.
<div ID="Left">
  <asp:UpdatePanel ID="upLeft" runat="server" UpdateMode="Conditional">
       <ContentTemplate>
             <telerik:RadTreeView ID="tvNodes" runat="server" EnableDragAndDrop="false" ExpandAnimation-Type="OutExpo"
                                        ExpandAnimation-Duration="800" EnableDragAndDropBetweenNodes="false"
                                        CollapseAnimation-Type="OutElastic"
                                        CollapseAnimation-Duration="800" Skin="Windows7" OnNodeDrop="tvNodes_HandleDrop"
                                        OnNodeExpand="tvNodes_NodeExpand" OnNodeClick="tvNodes_Click"
                                        OnContextMenuItemClick="tvNodes_ContextMenuItemClick"
                                        OnClientContextMenuItemClicking="onClientContextMenuItemClicking"
                                        OnClientContextMenuShowing="onClientContextMenuShowing"
                                        OnClientNodeDropping="onNodeDropping"
                                        OnClientNodeDragging="OnClientNodeDragging"
                                        OnClientNodeClicked="OnClientNodeClicked"
                                        OnClientNodeClicking="OnClientNodeClicking"
                                        OnClientNodePopulating="nodePopulating">
                                        <ContextMenus>
                                            <telerik:RadTreeViewContextMenu ID="NodesTreeMenu" runat="server" CssClass="MenuGroup"
                                                Skin="Windows7">
                                                <CollapseAnimation Type="none" />
                                            </telerik:RadTreeViewContextMenu>
                                        </ContextMenus>
                                        <WebServiceSettings Path="../ManageNode.asmx" Method="GetNodes"></WebServiceSettings>
                                    </telerik:RadTreeView>
    </ContentTemplate>
   </asp:UpdatePanel>
</div>
<div id="right">
     <asp:UpdatePanel ID="upright" runat="server" UpdateMode="Conditional">
         <ContentTemplate>
           <asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="Save" ValidationGroup="surveyValidate" />
            .......................... <!-- Other Controls -->
         </ContentTemplate>
       </asp:UpdatePanel>
</div>

When I clicked on node then I have loaded selected node-data into the right side controls which is in upRight update panel, when I perform click "btnSave" then we are updating node information and then call upleft.Update() to update treeview node,
after that If I want to populate child nodes for selected node then it will gives error like eventArgs.get_context() is null.

if upleft.Update()  is commented then perform above operation then the error is not occurred. But I have to update the Treeview information as well.

Please help me out why this error is occurred.

Thanks,
Mohmedsadiq Modan

1 Answer, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 30 Dec 2011, 04:56 PM
Hi,

How exactly do you update nodes?
Could you please send us a sample which demonstrates the issue to examine it locally?

Kind regards,
Helen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
TreeView
Asked by
mohmedsadiq modan
Top achievements
Rank 1
Answers by
Helen
Telerik team
Share this question
or