How to get the only leaf nodes selected values in raddropdowntree ?

3 posts, 0 answers
  1. SR
    SR avatar
    33 posts
    Member since:
    Dec 2013

    Posted 16 Jan 2014 Link to this post

    How to get the selected values leaf nodes of raddropdown tree  with chceck boxes .
    when  i am click to save button pass only leaf node values using comma separated  string ..


     
    Thanks!
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 16 Jan 2014 Link to this post

    Hi Suman,

    Please have a look into the following code snippet to achieve your scenario.

    ASPX:
    <telerik:RadDropDownTree ID="RadDropDownTree1" runat="server" DataFieldID="id" DataFieldParentID="parentid"
        CheckBoxes="CheckChildNodes" DataTextField="text" DataSourceID="SqlDataSource2">
    </telerik:RadDropDownTree>
    <telerik:RadButton ID="RadButton2" runat="server" Text="Save" OnClick="RadButton2_Click">
    </telerik:RadButton>

    C#:
    protected void RadButton2_Click(object sender, EventArgs e)
    {
        StringBuilder sb = new StringBuilder();
        foreach (RadTreeNode node in RadDropDownTree1.EmbeddedTree.CheckedNodes)
        {
            if (node.Nodes.Count == 0)
            {
                sb.Append(node.Text + ", ");
            }
        }
        string text = sb.ToString();
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. SR
    SR avatar
    33 posts
    Member since:
    Dec 2013

    Posted 16 Jan 2014 Link to this post

    Hi Princy,

    Thanks for your quick response finally i cracked the issue ..,


    Regards,
    Suman.


     
Back to Top