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.
Unfortunately, activation email could not send to your email. Please try again.

Grid Export

Thread ID:

Created:

Updated:

Platform:

Replies:

64200 Jul 16,2007 05:04 PM Jul 17,2007 10:11 AM Windows Forms 2
loading
Tags: GridControl
Chinedu
Asked On July 16, 2007 05:04 PM

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

haneefm [Syncfusion]
Replied On July 16, 2007 05:46 PM

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

Chinedu
Replied On July 17, 2007 10:11 AM

Thanks Haneef,

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

Thank you for the prompt reply

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;