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
- Binding WebGrid to AccessDataSource.
- 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
Tasks
Walkthrough: Allowing Export in WebGrid
How-to: Invoke Export feature programmatically
How-to: Export text when WebValueList is used
How-to: Use CacheToDisk feature to reduce memory usage
How-to: Set a different location for CacheToDisk feature
References
AllowExport Property
Export Event
ReportInfo Property
Other Resources
Walkthrough Topics
How-to Topics