Syncfusion.GridExcelConverter.GridExcelConverterControl gecc = new Syncfusion.GridExcelConverter.GridExcelConverterControl();
gecc.QueryImportExportCellInfo += gecc_QueryImportExportCellInfo;
gecc.GridToExcel(this.gridControl1.Model, saveFileDialog.FileName);
void gecc_QueryImportExportCellInfo(object sender, GridImportExportCellInfoEventArgs e)
{
if (e.Action == GridConverterAction.Export)
{
if (e.GridCell.CellType == GridCellTypeName.FormulaCell && e.GridCell.HasFormulaTag)
{
e.ExcelCell.Value = e.GridCell.FormattedText;
e.Handled = true;
}
}
}
Sample: http://www.syncfusion.com/downloads/support/forum/47121/ze/Export-1348171742
Regards,
Christo
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click
Dim gecc As New Syncfusion.GridExcelConverter.GridExcelConverterControl()
'hook this event to handle the exporting/importing style settings
AddHandler gecc.QueryImportExportCellInfo, AddressOf gecc_QueryImportExportCellInfo
'other codes
End Sub
Private Sub gecc_QueryImportExportCellInfo(ByVal sender As Object, ByVal e As GridImportExportCellInfoEventArgs)
If e.Action = GridConverterAction.Export Then
If e.GridCell.CellType = GridCellTypeName.FormulaCell AndAlso e.GridCell.HasFormulaTag Then
e.ExcelCell.Value = e.GridCell.FormattedText
e.Handled = True
End If
End If
End Sub
Sample: Export_VB
If we handle the ‘QueryImportExportCellInfo’ event, the other style settings (Eg. BackColor, Text color etc.. ) will be ignored. If we need that, we need to assign the needed style particularly.
Let me know if you still have any issues.
Regards,
Christo