My application uses master pages, I have a Prometheus RadGrid on my content page along with an asp:Image control that, when you mouseover it, displays a RadContextMenu with options for exporting grid data (Excel, PDF, etc.). I have the RadContextMenu controlling the grid via RadAjaxManagerProxy:
<telerik:AjaxSetting AjaxControlID="RadContextMenuExport">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="radgRoles" LoadingPanelID="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID="RadContextMenuExport" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
And I am handling the "AjaxRequestStart" event of the master page RadAjaxManager with the following script (as found on a telerik code library project):
function OnAjaxManagerRequestStart(ajaxManager, eventArgs)
{
var arg = eventArgs.EventTarget;
// If the object initiating this request was an "Export" button (for exporting RadGrid data)
// cancel the Ajax request so a normal postback occurs. This is required for RadGrid
// export functionality to work.
if (arg.substring(arg.length - 6) == 'Export') eventArgs.EnableAjax = false;
}
It works just fine but, after doing an export, the next time I click to expand/collapse a grouping in my grid, the OnAjaxManagerRequestStart function continues to recognize the control requesting the AjaxRequest as the RadContextMenu. As soon as I sort on the grid (or any other action), expand/collapse functionality returns to normal. Any ideas?