I would like to use standard ASP.NET file download response, like in other Stack Overflow question.
Response.ContentType = \"application/octet-stream\";
Respo
I was able to solve this by calling a javascript function, which calls __doPostBack with no __EVENTTARGET.
function GxGridView_Export(exportLink, exportType) {
var containingGrid = $(exportLink).closest("table .GxGridViewWithSlider");
__doPostBack('', containingGrid.attr('id') + "###" + exportType);
}
The server side Grid then parses the __EVENTARGUMENT and renders the export file.
var eventArg = Page.Request.Form["__EVENTARGUMENT"];
if (!string.IsNullOrEmpty(eventArg) && eventArg.Contains("###"))
{
var eventParams = eventArg.Split(new string[] { "###" }, StringSplitOptions.RemoveEmptyEntries);
if (eventParams.Length == 2 && eventParams[0] == this.ClientID)
{
ExportGrid(eventParams[1]);
return;
}
}