Articles in this section
Category / Section

How to export CellCommentTips to Excel by using GridExcelConverterControl?

1 min read

You can export the CellCommentTips of GridControl to excel by handling the QueryImportExportCellInfo event handler. In this event, the GridExcelTipStyleProperties is checked for ExcelTip properties and accordingly the comment is added to the IRange.

C#

//Create grid excel converter object
Syncfusion.GridExcelConverter.GridExcelConverterControl gecc = new Syncfusion.GridExcelConverter.GridExcelConverterControl();
//Hook the QueryImportExportCellInfo event to Export the comments.
gecc.QueryImportExportCellInfo += new Syncfusion.GridExcelConverter.GridImportExportCellInfoEventHandler(gecc_QueryImportExportCellInfo);
//Export the Comments to the Excel
void gecc_QueryImportExportCellInfo(object sender, Syncfusion.GridExcelConverter.GridImportExportCellInfoEventArgs e)
{
    ExcelCommentTip.GridExcelTipStyleProperties style = new ExcelCommentTip.GridExcelTipStyleProperties(e.GridCell);
    if (style.HasExcelTipText)
        e.ExcelCell.AddComment().Text = style.ExcelTipText;
}

 

 VB

'Create grid excel converter object
Private gecc As New Syncfusion.GridExcelConverter.GridExcelConverterControl()
'Hook the QueryImportExportCellInfo event to Export the comments.
Private gecc.QueryImportExportCellInfo += New Syncfusion.GridExcelConverter.GridImportExportCellInfoEventHandler(AddressOf gecc_QueryImportExportCellInfo)
'Export the Comments to the Excel
Private Sub gecc_QueryImportExportCellInfo(ByVal sender As Object, ByVal e As Syncfusion.GridExcelConverter.GridImportExportCellInfoEventArgs)
 Dim style As New ExcelCommentTip.GridExcelTipStyleProperties(e.GridCell)
 If style.HasExcelTipText Then
  e.ExcelCell.AddComment().Text = style.ExcelTipText
 End If
End Sub

 

Showing comment tips in grid

Figure 1: Comment Tips In GGC

 

Exported comment tips in excel

Figure 2: Exported Comment Tips in Excel

Sample Link:

ExportingCellTipCommetns-C#-1609704047.zip

ExportingCellTipComments-VB-868077761.zip

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied