How to pass additional parameter to server while exporting
The Export feature in Grid will allow the user to export the grid content to Excel, PDF or Word file formats. And the Grid model will be posted to the server on export operation.
If we want to send any additional parameter to the server then we can do this by adding the additional parameter to the grid model and retrieving it at the server side.
Let us discuss how to send a numeric textbox value along with grid model and retrieve it at the server while exporting.
The toolbar click handler for the MVC and ASP initialized Grid is as follows.
We have used the Web API controller to perform the export operation and we can also MVC controllers or ASP.Net web methods to perform export.
The following is the output generated from the above code example.
Figure 1: Grid with export enable and numeric textbox
Figure 2: Retrieving the additional parameter at the server side.
Figure 3: Exported Excel document.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|
|5441||09/22/2015||09/22/2015||ASP.NET Web Forms||Grid|
or the page will be automatically redirected to sign-in page in 10 seconds.