Query regarding treelist databindg...

4 posts, 0 answers
  1. md
    md avatar
    4 posts
    Member since:
    Jun 2011

    Posted 21 Jun 2011 Link to this post

    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>

     
  2. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 23 Jun 2011 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. md
    md avatar
    4 posts
    Member since:
    Jun 2011

    Posted 24 Jun 2011 Link to this post

    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>


  5. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 28 Jun 2011 Link to this post

    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.

Back to Top