records do not appear in the control!

7 posts, 0 answers
  1. Joe
    Joe avatar
    2 posts
    Member since:
    Feb 2012

    Posted 17 Feb 2012 Link to this post

    I am using Visual Studio 2010 Ultimate and am working with the trail Radcontrols.

    <telerik:RadTreeList ID="RadTreeList1" runat="server"
                AllowMultiColumnSorting="True" AllowSorting="True" AutoGenerateColumns="False"
                DataKeyNames="mynode" DataSourceID="SqlDataSource1"

    From what I have read since I am using a sqldatasource data control I should not have to include any additional code. Is that correct? 

    Can someone explain what I am missing or doing wrong?

    Thanks in advance.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 19 Feb 2012 Link to this post

    Hello Joe,

    Since you are setting AutoGenerateColumns as false, you need to explicitly define the columns. Also check the following demo.
    TreeList / Declarative Definition

  3. Joe
    Joe avatar
    2 posts
    Member since:
    Feb 2012

    Posted 22 Feb 2012 Link to this post

    Thanks for the reply Princy. I originally had autogenerate set to "TRUE" and when I couldn't get any data I began trying different settings.
    With Autogenerate="TRUE" The fieldnames apprear in the header but no records.

    I have also gone through the provided example and it seems to offer no insight into what I am doing wrong.

  4. Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 27 Feb 2012 Link to this post

    Hello Joe,

    Please ensure that you for sure have the fields set as DataKeyNames and ParentDataKeyNames into your SQL datasource. I would suggest you to try using the designer to bind the TreeLIst control as shown here.
    Follow the provided steps and let me know if this makes a deference.

    Kind regards,
    Maria Ilieva
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. joshua
    joshua avatar
    1 posts
    Member since:
    Sep 2011

    Posted 06 Apr 2012 Link to this post

    I am having this EXACT probelm.  I am trying just to do a simple bind.  all columns show up but" no records to display".  I do advanced Bind same thing.  I debug.  everything "seems fine"
  6. Keith Blackman
    Keith Blackman avatar
    5 posts
    Member since:
    Dec 2009

    Posted 06 Feb 2015 Link to this post

    I too am getting the "No records to display" message.
    To prove my SqlDataSource is working I have also added a RadGrid to the page connected to the same data source and it displays the data.
    I have added two RadTreeLists, one with AutoGenerateColumns="False", the other True.
    The page has a RadScriptManager followed by a RadAjaxManager.
    The suggested demo provides no clue as to the problem. I am using 2014.3 1209.
    Attached is a screen print of the results.
    02.    <form id="form1" runat="server">
    03.        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableTheming="True">
    04.            <Scripts>
    05.                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
    06.                </asp:ScriptReference>
    07.                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
    08.                </asp:ScriptReference>
    09.                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
    10.                </asp:ScriptReference>
    11.            </Scripts>
    12.        </telerik:RadScriptManager>
    13.        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    14.        </telerik:RadAjaxManager>
    15.    <div>
    16.    <telerik:RadTreeList ID="RadTreeList1" runat="server" DataKeyNames="LAID" DataSourceID="dsLATypeVersion" ParentDataKeyNames="TypeID" Skin="Silk" Width="376px" AutoGenerateColumns="False">
    17.        <ClientSettings Selecting-AllowItemSelection="true" />
    18.        <Columns>
    19.            <telerik:TreeListBoundColumn DataField="LocalAuthName" UniqueName="LocalAuthName" HeaderText="LocalAuthName" />
    20.            <telerik:TreeListBoundColumn DataField="Type" UniqueName="Type" HeaderText="Type" />
    21.            <telerik:TreeListBoundColumn DataField="Version" UniqueName="Version" HeaderText="Version" />
    22.        </Columns>
    23.    </telerik:RadTreeList>
    24.        <telerik:RadTreeList ID="RadTreeList2" runat="server" DataKeyNames="LAID" DataSourceID="dsLATypeVersion" ParentDataKeyNames="TypeID" Skin="Silk" Width="376px" AutoGenerateColumns="true">
    25.        <ClientSettings Selecting-AllowItemSelection="true" />
    26.        <Columns>
    27.            <telerik:TreeListBoundColumn DataField="LocalAuthName" UniqueName="LocalAuthName" HeaderText="LocalAuthName" />
    28.            <telerik:TreeListBoundColumn DataField="Type" UniqueName="Type" HeaderText="Type" />
    29.            <telerik:TreeListBoundColumn DataField="Version" UniqueName="Version" HeaderText="Version" />
    30.        </Columns>
    31.    </telerik:RadTreeList>
    33.        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="dsLATypeVersion" GroupPanelPosition="Top">
    34.            <MasterTableView AutoGenerateColumns="False" DataSourceID="dsLATypeVersion">
    35.                <Columns>
    36.                    <telerik:GridBoundColumn DataField="LocalAuthName" FilterControlAltText="Filter LocalAuthName column" HeaderText="LocalAuthName" SortExpression="LocalAuthName" UniqueName="LocalAuthName">
    37.                        <ColumnValidationSettings>
    38.                            <ModelErrorMessage Text="" />
    39.                        </ColumnValidationSettings>
    40.                    </telerik:GridBoundColumn>
    41.                    <telerik:GridBoundColumn DataField="Type" FilterControlAltText="Filter Type column" HeaderText="Type" SortExpression="Type" UniqueName="Type">
    42.                        <ColumnValidationSettings>
    43.                            <ModelErrorMessage Text="" />
    44.                        </ColumnValidationSettings>
    45.                    </telerik:GridBoundColumn>
    46.                    <telerik:GridBoundColumn DataField="Version" DataType="System.Int32" FilterControlAltText="Filter Version column" HeaderText="Version" SortExpression="Version" UniqueName="Version">
    47.                        <ColumnValidationSettings>
    48.                            <ModelErrorMessage Text="" />
    49.                        </ColumnValidationSettings>
    50.                    </telerik:GridBoundColumn>
    51.                    <telerik:GridBoundColumn DataField="LAID" DataType="System.Int32" FilterControlAltText="Filter LAID column" HeaderText="LAID" ReadOnly="True" SortExpression="LAID" UniqueName="LAID">
    52.                        <ColumnValidationSettings>
    53.                            <ModelErrorMessage Text="" />
    54.                        </ColumnValidationSettings>
    55.                    </telerik:GridBoundColumn>
    56.                    <telerik:GridBoundColumn DataField="TypeID" DataType="System.Int32" FilterControlAltText="Filter TypeID column" HeaderText="TypeID" ReadOnly="True" SortExpression="TypeID" UniqueName="TypeID">
    57.                        <ColumnValidationSettings>
    58.                            <ModelErrorMessage Text="" />
    59.                        </ColumnValidationSettings>
    60.                    </telerik:GridBoundColumn>
    61.                </Columns>
    62.            </MasterTableView>
    63.        </telerik:RadGrid>
    65.    <asp:SqlDataSource ID="dsLATypeVersion" runat="server" ConnectionString="<%$ ConnectionStrings:CCLCeremoniesConnectionString %>"
    66.        SelectCommand="SELECT tblLA.LAID, tblLA.LocalAuthName, tblLACeremonyType.TypeID, tblLACeremonyType.Type, tblVersions.Version FROM tblLA INNER JOIN tblLACeremonyType ON tblLA.LAID = tblLACeremonyType.LAID INNER JOIN tblVersions ON tblLACeremonyType.TypeID = tblVersions.TypeID ORDER BY tblLA.LocalAuthName, tblLACeremonyType.Type, tblVersions.Version"></asp:SqlDataSource>
    67.    </div>
    68.    </form>

  7. Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 11 Feb 2015 Link to this post

    Hi Keith,

    Please try setting DataKeyNames for the RdaGrid control to be the same as the TreeList DataKey and see how it goes.
    Also please try another combination of DataKeyNames and ParentDataKeyNames for the RadTreeList to see if this will make any deference.

    Maria Ilieva

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top