Hi all,
The issue is fixed and will be available as of R1 2021.
Then, if you want to show the status bar during export and hide it using the cookies approach, you would need to improve the OnCommand handler as follows:
function OnCommand(sender, args) {
if (args.get_commandName().indexOf("Export") > -1) {
// show status panel
var label = $get(sender._statusLabelID);
if (label)
{
label.title = sender._loadingText;
label.style["visibility"] = "visible";
}
pollingAPI.startPolling(function (cookieMessage) {
//alert(cookieMessage)
clearStatusPanel(sender)
}, 200);
}
}
Also, you would be able to use any loading panel instead of the status bar when exporting, e.g. RadAjaxLoadingPanel as explained here:
Regards,
Peter Milchev
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
OnItemCommand
="RadGrid1_ItemCommand"
ShowStatusBar
=
"true"
>
...
<
ClientSettings
>
<
ClientEvents
OnCommand
=
"OnCommand"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
protected
void
RadGrid1_ItemCommand(
object
sender, GridCommandEventArgs e)
{
if
(e.CommandName.Contains(
"Export"
))
{
// add cookie to know the file begins downloading
HttpCookie myCookie =
new
HttpCookie(
"file-download"
);
myCookie.Value =
"The file started downloading!"
;
HttpContext.Current.Response.Cookies.Add(myCookie);
}
}
<script src=
"polling-api.js"
></script>
<script>
function
OnCommand(sender, args) {
if
(args.get_commandName().indexOf(
"Export"
) > -1) {
pollingAPI.startPolling(
function
(cookieMessage) {
//alert(cookieMessage)
clearStatusPanel(sender)
}, 200);
}
}
function
clearStatusPanel(grid) {
var
label = $get(grid._statusLabelID);
if
(label) {
label.title =
""
;
label.style[
"visibility"
] =
"hidden"
;
}
}
</script>