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

bind rad drop down tree

1 Answer 56 Views
DropDownTree
This is a migrated thread and some comments may be shown as answers.
behnam
Top achievements
Rank 1
behnam asked on 17 Mar 2014, 08:42 AM
how to bind ad drop down tree with sqldata reader

1 Answer, 1 is accepted

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