Export RADGrid to PDF

2 posts, 0 answers
  1. Vivek
    Vivek avatar
    2 posts
    Member since:
    Apr 2015

    Posted 08 Apr 2015 Link to this post


    I am using a pop up with a Telerik grid with the following code. When I click on the default image of word/excel, I am unable to export the data on the grid and I am redirected to the primary page. I am using paging in my code.

    <telerik:RadGrid ID="gvHistory" runat="server" Width="100%" AutoGenerateColumns="false"
                                AlternatingRowStyle-CssClass="alternatingRowCss" GridLines="None" HeaderStyle-CssClass="gridHeader"
                                RowStyle-CssClass="windowShade" ShowHeader="true" HeaderStyle-Height="20px" AllowPaging="true"
                                 <ExportSettings HideStructureColumns="true">

                                <PagerStyle Mode="NumericPages" Height="25px"></PagerStyle>
                                <MasterTableView Width="100%" AllowMultiColumnSorting="True" HierarchyLoadMode="ServerOnDemand" CommandItemDisplay="Top" Style="padding: 3px;" >
                                    <CommandItemSettings ShowExportToWordButton="true"  ShowExportToCsvButton ="true" showAddNewRecordButton="false">
                                                <table width="100%">
                                                <tr class="gridHeader" style="height: 20px">
                                                    <td width="35%">Status
                                                    <td width="35%">Date
                                                    <td width="30%">Updated By
                                                <table width="100%">
                                                    <td width="35%" class="gridItem" style="padding: 3px;">
                                                        <asp:Label runat="server" ID="historyStatus" Text='<%# Eval("Status") %>'></asp:Label>
                                                    <td width="35%" class="gridItem" align="center" style="padding: 3px;">
                                                        <asp:Label runat="server" ID="historyUpdatedOn" Text='<%# Eval("UpdatedOn", "{0:MM/dd/yyyy}") %>'></asp:Label>
                                                    <td width="30%" class="gridItem" align="center" style="padding: 3px;">
                                                        <asp:Label runat="server" ID="HistoryCreatedBy" Text='<%# Eval("CreatedBy") %>'></asp:Label>
                                        <table width="100%" border="0" cellpadding="20" cellspacing="20">
                                                <td align="left" style="padding-left: 10px; font-family: Verdana">
                                                    <h2 style="color: Black; font-size: small">There are no records to display</h2>

  2. Daniel
    Daniel avatar
    4934 posts

    Posted 13 Apr 2015 Link to this post

    Hello Vivek,

    Judging by the description of the problem, the export button is ajaxified. You have to cancel the ajax request when exporting, otherwise this functionality would not work.
    You can find more information here:
    Export from Ajaxified Grid


    See What's Next in App Development. Register for TelerikNEXT.

Back to Top