Intersoft Support Center

Trigger Data Export in Client-side Programmatically

WebGrid provides method to trigger exporting from client-side.

In this topic, you will learn how to trigger data export in Client-Side programmatically.

To trigger data export in Client-Side

  1. Open WebGrid Designer and select Allow Exporting.
  2. Place a html button in the WebForm and named it as Button1.
  3. Put the following code under Button1_onclick() client-side event.

    Javascript Copy ImageCopy Code
    function Button1_onclick() 
    {        
       // retrieves WebGrid's object
       var WebGrid1 = ISGetObject("WebGrid1");                
       WebGrid1.ExportGrid("", "EXCEL", "PORTRAIT"); // export grid to excel
    }
                            

  4. Invoke Button1_onclick from the html button like following:

    <input id="Button1" type="button" value="Export From Client" language="javascript" onclick="return Button1_onclick()" />

  5. Run the project.
Previous Next