BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Hi Kevin,
Thank you for your interest
in Syncfusion Products.
In order to achieve your requirement please make use of QueryImportExportCellInfo
event of GridExcelConvertercontrol class. Please
refer the below code snippet and sample for reference. In this sample , Export button click has been hooked with the event QueryImportExportCellInfo.
CodeSnippet[c#]:
private void Export_Click(object sender, System.EventArgs
e)
{
Syncfusion.GridExcelConverter.GridExcelConverterControl gecc = new Syncfusion.GridExcelConverter.GridExcelConverterControl();
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.Filter
= "Files(*.xls)|*.xls";
saveFileDialog.DefaultExt
= ".xls";
gecc.QueryImportExportCellInfo
+= gecc_QueryImportExportCellInfo;
if(saveFileDialog.ShowDialog() == DialogResult.OK)
{
gecc.GridToExcel(this.gridDataBoundGrid1.Model,
saveFileDialog.FileName,
Syncfusion.GridExcelConverter.ConverterOptions.RowHeaders);
if(MessageBox.Show("Do you wish to open the xls file now?",
"Export to Excel", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
== DialogResult.Yes)
{
Process proc = new
Process();
proc.StartInfo.FileName
= saveFileDialog.FileName;
proc.Start();
}
}
}
void gecc_QueryImportExportCellInfo(object sender, GridImportExportCellInfoEventArgs
e)
{
if
(e.ColIndex > 0 && e.RowIndex > 0 && (this.gridDataBoundGrid1.Binder.InternalColumns[e.ColIndex-1].HeaderText
== "CustomerID"))
{
//now the column name with CustomerID has been
identified.
}
}
Sample:
http://www.syncfusion.com/downloads/support/directtrac/118359/CS-1568472712.zip
Please let us know if you have any other concerns.
Thanks & Regards,
AL.Solai.