Drop down tree how to get parent,child node selected value client said code

2 posts, 0 answers
  1. NA
    NA avatar
    39 posts
    Member since:
    Aug 2013

    Posted 30 Jan 2014 Link to this post

    Rad Drop down tree how to get parent,child   selected value  client said code
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 Jan 2014 in reply to NA Link to this post

    Hi,

    I guess you want to get the parent node and child node separately from the selected value of RadDropDownTree. Please have a look into the following code snippet.

    ASPX:
    <telerik:RadDropDownTree ID="RadDropDownTree1" runat="server" CheckBoxes="SingleCheck"
        OnClientDropDownClosed="OnClientDropDownClosed1" DataSourceID="SqlDataSource1"
        DataFieldID="id" DataFieldParentID="parentid" DataTextField="text">
    </telerik:RadDropDownTree>

    JavaScript:
    <script type="text/javascript">
        function OnClientDropDownClosed1(sender, args) {
            for (var i = 0; i < sender.get_entries().get_count(); i++) {
                var item = sender.get_entries()._array[i].get_text();
                if (sender.get_embeddedTree().findNodeByText(item)._hasChildren() == true)
                    alert("Parent" + item);
                else
                    alert("Child" + item);
            }
        }
    </script>

    Please elaborate your requirement if it doesn't help.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top