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

Exclude ShowExportToExcelButton from Dynamically created RadGrid

1 Answer 153 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 05 Jun 2018, 02:43 PM

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?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 07 Jun 2018, 04:38 PM
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.
Tags
Grid
Asked by
Matthew
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or