Disable Checkbox Server Side on Node

2 posts, 0 answers
  1. Mike
    Mike avatar
    17 posts
    Member since:
    Jan 2009

    Posted 09 Jul 2009 Link to this post

    My scenario is this, I have a parent check box and when it gets checked, I want to set its child checkboxes to checked and disable the checkboxes. I have seen many posts on how to do this client side, but none on server side. How can I do this server side? Thanks.

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

    Posted 10 Jul 2009 Link to this post

    Hi Mike,

    Give a try with following code in order to disable child nodes on checking a node.

    C#:
     
    protected void RadTreeView1_NodeCheck(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e) 
    {         
        if (e.Node.Checked) 
        { 
            for (int i = 0; i < e.Node.Nodes.Count; i++) 
            { 
                e.Node.Nodes[i].Enabled = false
            } 
        } 
        else 
        { 
            for (int i = 0; i < e.Node.Nodes.Count; i++) 
            { 
                e.Node.Nodes[i].Enabled = true
                e.Node.Nodes[i].Checked = false
            } 
        } 

    -Shinu.
Back to Top