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

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

1 Answer 396 Views
DropDownTree
This is a migrated thread and some comments may be shown as answers.
NA
Top achievements
Rank 1
NA asked on 30 Jan 2014, 09:02 AM
Rad Drop down tree how to get parent,child   selected value  client said code

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 30 Jan 2014, 09:51 AM
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.
Tags
DropDownTree
Asked by
NA
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or