we have a radgrid in a usercontrol created programatically and cusom command template created programatically having different buttons like links , export to excel, export to word , export to PDF and export to CSV. grid is ajaxified by RadAjaxmanager. Ajax is disabled on export action.
below is the code snipped used to disable ajax on grid export.
The issue is when we export and then click on links , the same export action is getting performed and grid doesnot reloads.
I tried to use the below code for registerpostbackcontrols for export buttons but its not working after grid operations like filtering, paging,sorting is performed and exported.
we need your help on this at earliest.
below is the code snipped used to disable ajax on grid export.
<telerik:RadScriptManager ID="RadGridListScriptManager" runat="server" />
<telerik:RadCodeBlock ID="RadGridListCodeBlock" runat="server">
<script type="text/javascript">
function onRequestStart(sender, args) {
if ((args.get_eventTarget().indexOf("ExportToExcelButton") >= 0) || (args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) || (args.get_eventTarget().indexOf("ExportToWordButton") >= 0) || (args.get_eventTarget().indexOf("ExportToPdfButton") >= 0)) {
args.set_enableAjax(false);
}
}
</script>
</telerik:RadCodeBlock>
<telerik:RadAjaxManager ID="RadGridListAjaxManager" runat="server">
<ClientEvents OnRequestStart="onRequestStart" />
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGridList">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGridList" LoadingPanelID="RadGridListAjaxLoadingPanel" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadGridListAjaxLoadingPanel" runat="server" Transparency="20"
CssClass="MyAjaxLoadingPanel" BackColor="#E0E0E0">
<table style="width: 100%; height: 100%;">
<tr style="height: 50%">
<td align="center" valign="middle" style="width: 50%">
<asp:Image ID="Image1" runat="server" AlternateText="Loading..." class="MyLoadingImage"
BorderWidth="0px" ImageUrl="~/images/loading1.gif"></asp:Image>
</td>
</tr>
</table>
</telerik:RadAjaxLoadingPanel>
The issue is when we export and then click on links , the same export action is getting performed and grid doesnot reloads.
I tried to use the below code for registerpostbackcontrols for export buttons but its not working after grid operations like filtering, paging,sorting is performed and exported.
Protected Sub RadGridList_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) If (TypeOf e.Item Is GridCommandItem) Then Dim btncmd As ImageButton = TryCast(TryCast(e.Item, GridCommandItem).FindControl("ExportToExcelButton"), ImageButton) RadGridListScriptManager.RegisterPostBackControl(btncmd) btncmd = TryCast(TryCast(e.Item, GridCommandItem).FindControl("ExportToWordButton"), ImageButton) RadGridListScriptManager.RegisterPostBackControl(btncmd) btncmd = TryCast(TryCast(e.Item, GridCommandItem).FindControl("ExportToCsvButton"), ImageButton) RadGridListScriptManager.RegisterPostBackControl(btncmd) btncmd = TryCast(TryCast(e.Item, GridCommandItem).FindControl("ExportToPdfButton"), ImageButton) RadGridListScriptManager.RegisterPostBackControl(btncmd) End IfEnd Sub