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

records do not appear in the control!

6 Answers 93 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 17 Feb 2012, 07:47 PM
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"
            ParentDataKeyNames="mynode2">
</telerik:RadTreeList>

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.

6 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 20 Feb 2012, 05:28 AM
Hello Joe,

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

Thanks,
Princy.
0
Joe
Top achievements
Rank 1
answered on 22 Feb 2012, 02:54 PM
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.

Joe
0
Maria Ilieva
Telerik team
answered on 27 Feb 2012, 08:40 AM
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.
0
joshua
Top achievements
Rank 1
answered on 06 Apr 2012, 06:40 PM
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"
0
Keith Blackman
Top achievements
Rank 1
answered on 06 Feb 2015, 04:55 PM
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.
01.body>
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>
32. 
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>
64. 
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>
69.</body>

Keith
0
Maria Ilieva
Telerik team
answered on 11 Feb 2015, 09:52 AM
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.

Regards,
Maria Ilieva
Telerik
 

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.

 
Tags
TreeList
Asked by
Joe
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Joe
Top achievements
Rank 1
Maria Ilieva
Telerik team
joshua
Top achievements
Rank 1
Keith Blackman
Top achievements
Rank 1
Share this question
or