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

Query regarding treelist databindg...

3 Answers 84 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
md
Top achievements
Rank 1
md asked on 21 Jun 2011, 10:29 AM
Hi all,

I want to bind my radtreelist control to database. em getting only the column names and not getting treelist structure...

 em pasting my below...
and also find the find attachment to know table view which is datasource to my treelist control... 

<

 

 

html xmlns="http://www.w3.org/1999/xhtml">

<

 

 

head runat="server">

 

<title></title>

</

 

 

head>

<

 

 

body>

 

<form id="form1" runat="server">

 

<telerik:RadScriptManager ID="scriptmanager" runat="server"></telerik:RadScriptManager>

 

<div>

 

<telerik:RadTreeList ID="treelist" runat="server"

 

AllowPaging="True" DataKeyNames="FirstName" ParentDataKeyNames="gender"

 

DataSourceID="SqlDataSource1" GridLines="Horizontal" AutoGenerateColumns="true"

 

ShowTreeLines="False" >

 

<PagerStyle Mode="NextPrev" />

 

</telerik:RadTreeList>

 

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

 

ConnectionString="<%$ ConnectionStrings:TestConnectionString1 %>"

 

SelectCommand="SELECT [MobileNumber], [P_Id], [FirstName], [MiddleName], [LastName], [JObTitle], [DOB], [EmailID], [gender] FROM [Persons]">

 

</asp:SqlDataSource>

 

</div>

 

</form>

</

 

 

body>

</

 

 

html>

 

3 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 23 Jun 2011, 10:54 AM
Hello md,

RadTreeList is used to display self-hierarchical data in a grid style. Could you please verify that the Persons table into your database are self-referencing table? Also the DataKeyNames and the ParentDataKeyNames properties should be of the same type. Does the type of the FirstName and gender fields are the same?
Also please check out the following online documentation article:
http://www.telerik.com/help/aspnet-ajax/treelist-understanding-structure.html

Looking forward for your reply.

Regards,
Radoslav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
md
Top achievements
Rank 1
answered on 24 Jun 2011, 07:15 AM
Hi Admin,
Thanks for the reply..
 my updated task status.. these are the modifications i tried to resolve my problem still unable to get results. 
  Em Attaching my database tableview Pls go thru it,
1. employeeid is of type int and it is used as Datakeynames.
2.reportsto is of type int and it is used as Parentdatakeynames.
and the corresponding treelist and datasource code..

<

telerik:RadAjaxPanel ID="panel" runat="server"><telerik:RadTreeList ID="treelist" runat="server" DataKeyNames="employeeid" ParentDataKeyNames="reportsto" DataSourceID="SqlDataSource1" GridLines="Horizontal" AllowMultiItemSelection="True" AllowPaging="True" ></telerik:RadTreeList>

 

</telerik:RadAjaxPanel><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString1 %>" SelectCommand="SELECT [employeeid], [Firstname], [Lastname], [Joiningdate], [Position], [reportsto] FROM [empdetails]"></asp:SqlDataSource>


0
Radoslav
Telerik team
answered on 28 Jun 2011, 12:55 PM
Hello md,

Could you please try setting NULL as a value of the reportsto field of the first row into your database and let me know if the issue still persists? For example:
1 anil kumar 1999-02-3 developer NULL
Additionally I am sending you a simple example based on your code. Please check it out and let me know if it helps you.

Greetings,
Radoslav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
TreeList
Asked by
md
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
md
Top achievements
Rank 1
Share this question
or