bind rad drop down tree

2 posts, 0 answers
  1. behnam
    behnam avatar
    2 posts
    Member since:
    Mar 2014

    Posted 17 Mar 2014 Link to this post

    how to bind ad drop down tree with sqldata reader
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 17 Mar 2014 in reply to behnam Link to this post

    Hi behnam,

    Please try the following code snippet which works fine at my end.

    C#:
    SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString);
    const string SQL = "SELECT * FROM [Details] ";
    SqlCommand myCommand = new SqlCommand(SQL, myConnection);
    myConnection.Open();
    SqlDataReader myReader = myCommand.ExecuteReader();
    RadDropDownTree1.DataFieldID = "id";
    RadDropDownTree1.DataFieldParentID = "parentid";
    RadDropDownTree1.DataTextField = "text";
    RadDropDownTree1.DataSource = myReader;
    RadDropDownTree1.DataBind();
    myReader.Close();
    myConnection.Close();

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