Simple Detail Table not showing up

3 posts, 0 answers
  1. Corey
    Corey avatar
    8 posts
    Member since:
    Feb 2007

    Posted 09 Jul 2008 Link to this post

    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. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 09 Jul 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 10 Jul 2008 Link to this post

    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.
Back to Top