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

Simple Detail Table not showing up

2 Answers 187 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Corey
Top achievements
Rank 1
Corey asked on 09 Jul 2008, 02:45 PM
I have a simple Master/Detail Table structure that is not showing up correctly.  I am trying to show the details table but it comes up with No Child Records found.  I have followed the online samples and looked in all Telerik support but I have found no solution as to why it is not working correctly.    Additionally I have tried all sort of parameters, Control Parameter based on RadGrid1.SelectedValue, Session Control Parameter and more.  Can anyone give me any assistance.  Here is my code.  There is no code-behind.

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

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

SelectCommand="SELECT Email, FirstName, LastName, Phone, Office, Image, RecordID FROM dropdown_qry WHERE (Image IS NOT NULL) ORDER BY LastName, FirstName">

</asp:SqlDataSource>

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

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

SelectCommand="SELECT [RecordID], [JobTitle], [Department], [Assistant], [OfficeStreet], [State], [Hired], [OfficeNumber], [Extension] FROM [qry_UserProfileList] WHERE ([RecordID] = @RecordID)">

<SelectParameters>

<asp:SessionParameter Name="RecordID" SessionField="RecordID" Type="Int64" />

</SelectParameters>

</asp:SqlDataSource>

<br />

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"

DataSourceID="SqlDataSource1" GridLines="None" Skin="Outlook">

<

MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="RecordID">

<DetailTables>

<telerik:GridTableView runat="server"

DataSourceID="sqldatasource2" >

<ParentTableRelation>

<telerik:GridRelationFields DetailKeyField="RecordID"

MasterKeyField="RecordID" />

</ParentTableRelation>

</telerik:GridTableView>

</DetailTables>

<

ExpandCollapseColumn Visible="True">

<

HeaderStyle Width="20px"></HeaderStyle>

</

ExpandCollapseColumn>

<Columns>

<telerik:GridBoundColumn DataField="Email" HeaderText="Email"

SortExpression="Email" UniqueName="Email">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="FirstName" HeaderText="FirstName"

SortExpression="FirstName" UniqueName="FirstName">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="LastName" HeaderText="LastName"

SortExpression="LastName" UniqueName="LastName">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="Phone" HeaderText="Phone"

SortExpression="Phone" UniqueName="Phone">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="Office" HeaderText="Office"

SortExpression="Office" UniqueName="Office">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="Image" HeaderText="Image"

SortExpression="Image" UniqueName="Image">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="RecordID" DataType="System.Int64"

HeaderText="RecordID" SortExpression="RecordID" UniqueName="RecordID">

</telerik:GridBoundColumn>

</Columns>

</

MasterTableView>

</telerik:RadGrid>

Thank you.
Corey Hambrick

2 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 09 Jul 2008, 02:56 PM
Hello Corey,

Please note that you have set AutoGenerateColumns="false" as a global RadGrid property. This means your detail tables will not autogenerate any columns too. And I don't see any columns defined for the DetailTable of the MasterTableView.

Please either set AutoGenerateColumns="true" for the child tableview, or define some columns manually.

All the best,
Veli
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Shinu
Top achievements
Rank 2
answered on 10 Jul 2008, 07:22 AM
Hi Corey,

You can refer the following help articles to get more information on GridHierarchy.

What you should know
Understanding hierarchical grid structure
Three-level hierarchy

Thanks
Shinu.
Tags
Grid
Asked by
Corey
Top achievements
Rank 1
Answers by
Veli
Telerik team
Shinu
Top achievements
Rank 2
Share this question
or