Default Selected Node

3 posts, 1 answers
  1. Mike
    Mike avatar
    76 posts
    Member since:
    Mar 2013

    Posted 20 May 2014 Link to this post

    I have a RadDropDownTree control on a page, I can successfully bind data to it [and read back the selected node's value], and I can successfully set the value BACK on loading a form.  However, when I programmatically set the selected node, it doesn't show up on the page.  I have to manually expand the DropDownTree and select the already selected item.

    How can I have the DropDownTree ACTUALLY select the node programmatically?

    I'm using Telerik ASP.NET AJAX v2014.1403.45
  2. Answer
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 20 May 2014 in reply to Mike Link to this post

    Hi Mike,

    Please have a look into the sample code snippet to select a node a programmatically.

    <telerik:RadDropDownTree runat="server" ID="RadDropDownTreeTest" DataTextField="LastName"
        DataFieldParentID="ReportsTo" DataFieldID="EmployeeID" DataValueField="EmployeeID"
        DataSourceID="SqlDataSource2"  OnDataBound="RadDropDownTreeTest_DataBound">
        <DropDownSettings OpenDropDownOnLoad="true" />

    protected void RadDropDownTreeTest_DataBound(object sender, EventArgs e)
        RadDropDownTreeTest.SelectedText = "Davolio";
        RadDropDownTreeTest.SelectedValue = "3";

  3. Mike
    Mike avatar
    76 posts
    Member since:
    Mar 2013

    Posted 21 May 2014 in reply to Shinu Link to this post

    Awesome, that solved my issue, thanks!
Back to Top