Displaying a list of n records inside a Grid nestedviewtemplate

2 posts, 0 answers
  1. CoGG
    CoGG avatar
    5 posts
    Member since:
    Jul 2012

    Posted 20 Jun 2016 Link to this post

    Please refer to the attached image of what i hope to achieve with using a radgrid, 

    Basically I want to show a list of values underneath the details of the record i'm looking at.
    my code is as follows: 

    <telerik:RadGrid runat="server" DataSourceID="APPLICATIONS_DATASOURCE" ID="RADGRID1" OnDetailTableDataBind="MYMETHOD">
                    <MasterTableView AutoGenerateColumns="false" DataKeyNames="DATA_ID">
                            <telerik:GridTableView Name="Contacts" DataKeyNames="CONTACT_ID" AutoGenerateColumns="true">
                            <telerik:GridBoundColumn DataField="TITLE" HeaderText="Title"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="DATA" HeaderText="Data"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="DATE" HeaderText="Date"></telerik:GridBoundColumn>
                            <div class="row">
                                <div class="span11">
                                        <asp:Literal ID="Literal1" runat="server" Text='<%#eval("TITLE") %>'></asp:Literal>                                            </h3>
                                        <asp:Literal ID="Literal2" runat="server" Text='<%#eval("OWNER") %>'></asp:Literal>                                            </h5>
                                <div class="span11">
                                        <asp:Literal ID="Literal3" runat="server" Text='<%#eval("ALLDETAILS") %>'></asp:Literal></p>
                                <div class="span11">

    As the DetailsTable has N number of elements, i have it using a generated datatable on bind to fill with data, and the nestedview can be split to a seperate datasource if need be, but currently is using the radgrid datasource (sqldatasource).

    Is there a way to accomplish a nestedview AND a detailsTable on the same hierarchical level in a Grid that i might have missed ?

  2. Eyup
    Eyup avatar
    4080 posts

    Posted 23 Jun 2016 Link to this post

    Hi Matthew,

    Generally, RadGrid provides DetailItemTemplate, which you can use with built-in DetailTables hierarchy structure:

    However, in your scenario using templates seems more appropriate. Therefore, you will need to remove the DetailTables and place the second grid within a NestedViewTemplate:

    For displaying the persons linked to the item in a Card-View fashion, you can use a RadListView:

    I am also sending a sample RadGrid/RadListView web site to demonstrate a similar implementation.

    I hope this will prove helpful.

    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top