This is a migrated thread and some comments may be shown as answers.

confirmation for exporting

1 Answer 13 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Erin
Top achievements
Rank 1
Erin asked on 10 Dec 2013, 12:16 PM
hi
Is it possible to have a confirm appear for exporting. I want to show a confirmation to user asking if he wants to export. How to do it?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Dec 2013, 12:28 PM
Hi Erin,

Please try the following code snippet.

ASPX:
<telerik:RadButton ID="ExportBtn" runat="server" Text="ExportToExcel" OnClick="ExportBtn_Click" OnClientClicking="OnClientClicking">
</telerik:RadButton>

C#:
protected void ExportBtn_Click(object sender, EventArgs e)
{  
  RadGrid1.MasterTableView.ExportToExcel();
}

JS:
function OnClientClicking(sender, args) {
   var callBackFunction = Function.createDelegate(sender, function (argument) {
     if (argument) {
        this.click();
       }
    });
    var text = "Are you sure you want to Export the Grid?";
    radconfirm(text, callBackFunction, 300, 100, null, "Title");
    args.set_cancel(true);
 }

Thanks,
Princy
Tags
Grid
Asked by
Erin
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or