Exclude ShowExportToExcelButton from Dynamically created RadGrid

2 posts, 0 answers
  1. Matthew
    Matthew avatar
    2 posts
    Member since:
    May 2016

    Posted 05 Jun 2018 Link to this post

    I am dynamically creating an ajaxified RadGrid in an asp:UpdatePanel in a user control.

    The RadGrid is created in Page_Init,and the MasterTableView.CommandItemSettings.ShowExportToExcelButton set true;

    The RadGrid is added to the RadAjaxManagerProxy AjaxSettings in Page_Load, in if (!Page.IsPostBack).

    My problem is that after postback, the export button is not set to trigger a postback (it's not excluded from Ajax). I gather it is excluded automatically on the original page load when the RadGrid is added to the AjaxSettings, but it doesn't happen after a ajax update to the RadGrid (sorting, or filtering, for example).

    I read this article, but I can't resolve my problem: Export from Ajaxified Grid

    If I inspect the button in the browser before and after an ajax update this is what I see:

    BEFORE:
    <input name="ctl00$MainContent$ucSystems$rgSystems$ctl00$ctl02$ctl00$ExportToExcelButton" title="Export to Excel" class="rgExpXLS" id="ctl00_MainContent_ucSystems_rgSystems_ctl00_ctl02_ctl00_ExportToExcelButton" onclick="javascript:__doPostBack('ctl00$MainContent$ucSystems$rgSystems$ctl00$ctl02$ctl00$ExportToExcelButton','')" type="button" value=" ">

    AFTER:

    <input
    name="ctl00$MainContent$ucSystems$rgSystems$ctl00$ctl02$ctl00$ExportToExcelButton"
    title="Export to Excel" class="rgExpXLS" id="ctl00_MainContent_ucSystems_rgSystems_ctl00_ctl02_ctl00_ExportToExcelButton"
    type="submit" value=" ">

    How can I get the postback on the ExportToExcelButton after an ajax update to the RadGrid?

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5361 posts

    Posted 07 Jun 2018 Link to this post

    Hello Matthew,

    If you will be using RadAjax to AJAX-enable the grid, you must:

    With this, when only RadAjaxManager is used to AJAX-enable the grid correctly, its built-in export should work automatically. If not, try:

     


    Regards,
    Marin Bratanov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top