RadTreeView Three-state check box

2 posts, 0 answers
  1. Lubomir
    Lubomir  avatar
    15 posts
    Member since:
    Sep 2012

    Posted 09 Jan 2015 Link to this post

    Hi,
    is it possible to make three-state check box in tree view ?
    This is my tree view -
                                        <telerik:RadTreeView
                                        ID="theTree"
                                        runat="server"
                                        EnableDragAndDrop="false"
                                        AllowNodeEditing="false"
                                        MultipleSelect="false"
                                        EnableDragAndDropBetweenNodes="false"
                                        CheckBoxes="true"
                                        OnClientNodeClicking="OnClientNodeClicking"
                                        OnClientNodeChecked="ClientNodeChecked"                                                                   
                                        > 
    I add nodes dynamically from javascript.
    TriStateCheckBoxes = "true" - not working for me
  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    837 posts

    Posted 09 Jan 2015 Link to this post

    Hello,

    I created a sample project to test the described issue but could not reproduce it. The RadTreeView control displays the checkboxes as expected with the TriStateCheckBoxes property set to true, before and after adding a new node.

    <script type="text/javascript">
        function OnClientClicked(sender, args) {
            AddNode();
        }
     
        function AddNode() {
            var tree = $find("<%= RadTreeView1.ClientID %>");
             tree.trackChanges();
             var node = new Telerik.Web.UI.RadTreeNode();
             node.set_text("New Node");
             tree.get_nodes().getNode(0).get_nodes().add(node);
             tree.commitChanges();
         }
    </script>
        <div class="demo-containers">
            <div class="demo-container size-narrow">
    <telerik:RadTreeView ID="RadTreeView1" runat="server" CheckBoxes="True" TriStateCheckBoxes="true">
        <Nodes>
            <telerik:RadTreeNode Text="Software" Expanded="true">
                <Nodes>
                    <telerik:RadTreeNode Text="Business &amp; Office">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode Text="Database">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode Text="Networking">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode Text="Presentation">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode Text="Project Management">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode Text="Reports">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode Text="Spreadsheet">
                    </telerik:RadTreeNode>
                    <telerik:RadTreeNode Text="Word Processing">
                    </telerik:RadTreeNode>
                </Nodes>
            </telerik:RadTreeNode>  
        </Nodes>
    </telerik:RadTreeView>
    <br />
    <telerik:RadButton AutoPostBack="false" ID="RadButton1" runat="server" OnClientClicked="OnClientClicked"></telerik:RadButton>



    Regards,
    Ivan Danchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top