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

RadGrid - ItemTemplate Eval statement returning one element.

1 Answer 14 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 12 Apr 2021, 02:53 PM

I am trying to display a list of items and have created an Item Template to create a customizable pdf. I have tried creating another RadGrid within an Item Template, however the designer will not pickup the new RadGrid there. I would like to display the entire ClassList

<telerik:RadGrid RenderMode="Lightweight" ID="RadGridWrapper1" runat="server" OnItemCommand="radGridClasses_ItemCommand"
    OnNeedDataSource="RadGridWrapper1_NeedDataSource" GroupingEnabled="true" AllowPaging="true" >
    <ExportSettings OpenInNewWindow="true" ExportOnlyData="false" Pdf-BorderType="NoBorder" >
        <Pdf DefaultFontFamily="Arial Unicode MS" AllowPrinting="true" ForceTextWrap="true" BorderType="NoBorder" >
            <PageHeader>
                <LeftCell TextAlign="Center" />
                <MiddleCell TextAlign="Center" Text="My Class List" />
                <RightCell Text="Page: <?page-number?>" TextAlign="Center" />
            </PageHeader>
        </Pdf>
    </ExportSettings>
    <MasterTableView AutoGenerateColumns="false" ShowHeader="false" CommandItemDisplay="top" TableLayout="Auto" >
        <CommandItemTemplate>
            <div class="container-fluid m-3">
                <asp:LinkButton ID="btnExport" CommandName="ExportToPdf" runat="server" CssClass="mr-3 float-right" ToolTip="Export to PDF">
                    <i class="fas fa-3x fa-file-pdf"></i>
                </asp:LinkButton>
            </div>
        </CommandItemTemplate>
        <CommandItemSettings ShowExportToCsvButton="false" ShowExportToExcelButton="false" ShowExportToPdfButton="true"
            ShowExportToWordButton="false" ShowAddNewRecordButton="false" />
                <Columns>
                    <telerik:GridTemplateColumn UniqueName="ClassListDisplay">
                        <ItemTemplate>
                            <table style="width: 100%; text-align: left">
                                <colgroup>
                                    <col />
                                </colgroup>
                                <tr style="border:none">
                                    <td> </td>
                                </tr>
                                <tr style="font-size: 14pt; margin-top: 5px; padding-top:5px; vertical-align: middle; text-align: left; border-top: 2px solid; background-color: lightgray;"
                                    class="greyHeader">
                                    <td>
                                        <i>INFO...</i>
                                    </td>
                                    <td></td>
                                </tr>
                                <tr style="border:none">
                                    <td> </td>
                                </tr>
                                <tr>
                                    <td><b>Classes</b>: <%# Eval("ClassList") %></td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
    </MasterTableView>
</telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 15 Apr 2021, 08:08 AM

Hi Brian,

Template Columns are always custom, and when it comes to exporting, you will need to follow a few additional steps to extract the data. Please check out the Export Template Columns article and follow the instructions to export Template Columns.

Regards,
Attila Antal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Brian
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or