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

radtreeview databind

1 Answer 60 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
geetha priya
Top achievements
Rank 1
geetha priya asked on 22 Jun 2010, 08:12 AM
hi!

i am using radtreeview databind... here is my code...

 

<telerik:RadTreeView ID="RadTreeView1" runat="server" DataFieldID="emailid"

 

 

DataTextField="name" DataSourceID="SqlDataSource1" Skin="Sitefinity" >

 

 

 

<DataBindings>

 

 

 

<telerik:RadTreeNodeBinding Expanded="true" />

 

 

</DataBindings>

 

 

</telerik:RadTreeView>

 

 

<asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource>


cs page code is....

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

connectionString = System.Configuration.

ConfigurationSettings.AppSettings["connstring"];

 

 

 

 

SqlDataSource1.ConnectionString = connectionString;

SqlDataSource1.SelectCommand =

"select * from chat_status where tempstatus='online'";

 

 

}

from this i can able to get the names from my table but its not look like treeview structure...
i am getting only the root node.. whats wrong with this code... plz help me...

thanks..in advance...

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 Jun 2010, 12:50 PM
Hi Geetha,


Minimally, to bind hierarchical data you must assign the DataSource, DataFieldID, DataParentFieldID and DataTextField properties of the RadTreeView.

Go through the documentations for more information.
Binding to Hierarchical Data
Binding to a Database

-Shinu.
Tags
TreeView
Asked by
geetha priya
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or