We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid Export

When I export my GridGroupingControl to excel I get the caption row and a blank row below the headers.

Is there a way to get rid of the caption row and blank row

I have added a zip file of the example export

MyTest0.zip

2 Replies

HA haneefm Syncfusion Team July 16, 2007 09:46 PM UTC

Hi Nedu,

We have newly added the ExportElement event in Essential Grid v5.1. This event handler allows you to customize of export element from grid to excel. It allows you to remove the element from excel export process.It also enable the changing of the cell definition at excel export process. You can handle this event and set e.Cancel to true to cancel element export from grid to excel. Below is a code snippet that shows this task.

[c#]
GroupingGridExcelConverterControl converter = new GroupingGridExcelConverterControl();
converter.ExportElement += new GroupingGridExcelConverterControl.GridExportElementEventHandler(converter_ExportElement);
converter.GroupingGridToExcel(this.gridGroupingControl1, saveFileDialog.FileName, options);

void converter_ExportElement(object sender, GridExportElementEventArgs e)
{
if (e.Element.Kind == DisplayElementKind.AddNewRecord
|| e.Element.Kind == DisplayElementKind.Caption)
{
e.Cancel = true; // Cancelling export of the GroupCaption and AddNewRecord Element in a grid.

}
}

Best regards,
Haneef


CH Chinedu July 17, 2007 02:11 PM UTC

Thanks Haneef,

I guess I'll have to start thinking about migrating to 5.1

Thank you for the prompt reply

Loader.
Live Chat Icon For mobile
Up arrow icon