Hi Telerik team
I have a RadGrid with the a GridButtonColumn like below
CodeBehind:
.ashx
The problem is, The loading pannel over RadGrid, still running after the file exported.
Can you help me with this issue.
Thanks
Giuliano
I have a RadGrid with the a GridButtonColumn like below
<
telerik:GridButtonColumn
UniqueName
=
"DeliveryNote"
CommandName
=
"DeliveryNote"
ImageUrl
=
"~/Content/Images/16/notes.png"
ButtonType
=
"ImageButton"
Text="<%$ Resources:Resource, GridItemEditDeliveryNoteToolTip %>">
</
telerik:GridButtonColumn
>
CodeBehind:
protected
void
RadGridDeliveryNotesOnItemCommand(
object
sender, GridCommandEventArgs e)
{
var gridDataItem = e.Item
as
GridDataItem;
if
(!ReferenceEquals(gridDataItem,
null
))
{
var idDeliveryNote = Convert.ToInt32(gridDataItem.OwnerTableView.DataKeyValues[e.Item.ItemIndex][
"Id"
]);
if
(e.CommandName == RadGrid.DeleteCommandName)
{
BL.Domain.DeliveryNote.Instance.DeleteById(idDeliveryNote);
}
if
(e.CommandName ==
"DeliveryNote"
)
{
Response.Redirect(
string
.Format(
"Processor.ashx?idDeliveryNote={0}"
, idDeliveryNote),
true
);
}
}
}
.ashx
public
class
Processor : IHttpHandler
{
public
void
ProcessRequest(HttpContext context)
{
var idDeliveryNote = context.Request.ProcessQueryString(
"idDeliveryNote"
);
var report =
new
Reports.DeliveryNote();
report.ReportParameters[
"IdDeliveryNote"
].Value = idDeliveryNote;
context.Response.Clear();
context.Response.Buffer =
true
;
context.Response.ClearHeaders();
context.Response.ClearContent();
var reportProcessor =
new
ReportProcessor();
var pdfResult = reportProcessor.RenderReport(
"PDF"
, report,
null
);
var file = pdfResult.DocumentBytes;
context.Response.ContentType =
"application/pdf"
;
context.Response.Charset =
string
.Empty;
context.Response.AddHeader(
"Content-Length"
, file.Length.ToString(CultureInfo.CurrentCulture));
var attachment =
string
.Format(
"attachment; filename={0}.{1}"
,
"file-name"
,
"pdf"
);
context.Response.AddHeader(
"content-disposition"
, attachment);
var bytes = file;
context.Response.BinaryWrite(bytes);
context.Response.End();
}
}
The problem is, The loading pannel over RadGrid, still running after the file exported.
Can you help me with this issue.
Thanks
Giuliano