Need an exporting grid

6 posts, 3 answers
  1. DoomerDGR8
    DoomerDGR8 avatar
    133 posts
    Member since:
    Aug 2010

    Posted 02 Dec 2010 Link to this post

    Hi! I require all of my RadGrids using the below Skin to ge exportable without paging. Issue is that all grids are on Content Pages that inherit a Single Master page with a RadAjaxManager. All child pages have a RadAjaxManagerProxy. So all grids are AJAXified. I'm into completion here so a major overhaul is not optional. kindly advice a strategy. All grids have different names, btw.

    Thanks.

    <telerik:RadGrid runat="server" GridLines="None" Skin="Office2007" SkinID="RadGrid_UnPageable" >   
        <MasterTableView EnableNoRecordsTemplate="true" ShowHeadersWhenNoRecords="true">
          <CommandItemSettings ShowRefreshButton="true" ShowExportToWordButton="false" ShowExportToExcelButton="false" ShowExportToPdfButton="false" ShowExportToCsvButton="false" />
            <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" Position="Bottom" />
            <NoRecordsTemplate>There is no data to display.</NoRecordsTemplate>
        </MasterTableView>
        <ExportSettings HideStructureColumns="true" ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" />
        <ClientSettings>
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
    </telerik:RadGrid>
  2. Answer
    Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 02 Dec 2010 Link to this post

    Hello Hassan,

    You can easily cancel the AJAX request when exporting as explained in the help topic below:
    Export from ajaxified grid

    As to the built-in skins - I'm afraid it is not possible to export RadGrid together with its skin. Please examine the following links for more information about the supported formats:
    PDF export
    Word/Excel export (HTML-based)
    CSV export
    ExcelML basics

    Best regards,
    Daniel
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. DoomerDGR8
    DoomerDGR8 avatar
    133 posts
    Member since:
    Aug 2010

    Posted 02 Dec 2010 Link to this post

    Hello! Thanks for the prompt response. The topic you mentioned suggests to turn off AJAX on RadGrids by looking up a RadGrid on the base of it's name or separate exporting buttons (other then the ones that are defined in the Command Bar of the Grid) and that's not a possible scenario for me. As to exporting with skins, I don't require that. I just said that my RadGrids are using a SkinID. And I have the Commands for exporting enabled through skin. I just want the Grids to export.
  5. Answer
    Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 02 Dec 2010 Link to this post

    Hello Hassan,

    The export functionailty won't work with asynchronous request so you will have to find a way to disable/cancel the AJAX requests and perform a normal postback instead. The easiest way would be to put this code in your masterpage.
    <script type="text/javascript">
       function onRequestStart(sender, args)
       {
           if (args.get_eventTarget().indexOf("Export") >= 0)
               args.set_enableAjax(false);
       }
    </script>

    This way you will disable AJAX for all controls that have "Export" in their IDs.

    Regards,
    Daniel
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  6. DoomerDGR8
    DoomerDGR8 avatar
    133 posts
    Member since:
    Aug 2010

    Posted 02 Dec 2010 Link to this post

    Okay. Now we are getting somewhere. It makes sense to disable AJAX for exporting but do we need to enable it back? I'm currently trying out your suggestion.
  7. Answer
    Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 02 Dec 2010 Link to this post

    Hello Hassan,

    No, you don't have to turn it back on. You can see this approach in action on our online demos:
    MS Excel/MS Word/CSV
    Export to ExcelML

    Best regards,
    Daniel
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017