Intersoft WebGrid Documentation
How-to: Customize Export function
See Also Send comments on this topic.

Glossary Item Box

Sometimes when you export WebGrid, you would like the output such as the font, WebGrid's column or WebGrid's column width to be different.

In this topic, you will learn how to customize export function.

To customize export function

  1. Binding WebGrid to AccessDataSource.
  2. In the Export server side event of WebGrid.

    C# Copy Code
       e.Table.Columns.GetNamedItem("CustomerID").Visible = false; //hidden CustomerID's column
    e.Table.Columns.GetNamedItem("Address").Width = Unit.Pixel(300); //set Address's column width to 300px
       //Set Export's font
       e.ReportInfo.DynFonts = new DynARFonts(new Font("Tahoma",15), null, null, null, null, null, null, null, null);
    e.ReportInfo.ReportName = "WebGridExport"; //set WebGrid export file name

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.