Intersoft WebGrid Documentation
How-to: Trigger Data Export in Client-Side Programmatically
See Also Send comments on this topic.

Glossary Item Box

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.NET 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.

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.