Checking Nodes Client Side - TrackChanges not working

3 posts, 0 answers
  1. Feizal Amlani
    Feizal Amlani avatar
    91 posts
    Member since:
    Feb 2007

    Posted 11 May 2009 Link to this post

    Hello,

    I am adding a Node on the client side and checking the node as follows; 

    nodeDetails.check();

    nodeDetails.set_checked(

    true);

    I am also using trackchanges/commit to persist the new node and its state on the server.  Everything is fine but when I look at the Node on the server side it is not checked. 

    Has anyone experienced a similar issue.

    Thanks.

     

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 15 May 2009 Link to this post

    Hello Feeizel,

    I tried the scenario and it is working fine in my end (with the latest version of RadControls). Here is the code which I tried.

    ASPX:
     
    <telerik:radtreeview id="RadTreeView2" runat="server" CheckBoxes="true"
    <Nodes> 
     . . . 
    </Nodes> 
    </telerik:radtreeview> 
    <asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="Get Checked" /> 
    <input id="Button4" type="button" value="button" onclick="AddNode();" /> 

    JavaScript:
     
    <script type="text/javascript"
    function AddNode() 
       var tree = $find("<%= RadTreeView1.ClientID %>"); 
       tree.trackChanges(); 
       var node = new Telerik.Web.UI.RadTreeNode(); 
       node.set_text("New Node"); 
       node.set_checked(true); 
       tree.get_nodes().add(node); 
       tree.commitChanges(); 
    </script> 

    CS:
     
    protected void Button3_Click(object sender, EventArgs e) 
        if (RadTreeView1.CheckedNodes.Count > 0) 
        { 
            string text = RadTreeView1.CheckedNodes[0].Text; 
            Response.Write(text); 
            Response.Write(RadTreeView1.CheckedNodes.Count); 
        } 
    Can you paste the code that you tried, if that is different from this?

    Thanks,
    Shinu.
  3. Feizal Amlani
    Feizal Amlani avatar
    91 posts
    Member since:
    Feb 2007

    Posted 15 May 2009 Link to this post

    Thanks.

    I have an older version and was having the issue.  Once I upgraded it seems to be okay.

    Feizal
Back to Top