Articles in this section
Category / Section

How to export the Tooltip values to excel from GridControl ?

1 min read

Tooltip of the grid cells can be exported to excel with the help of QueryImportExportCellInfo event. In the given sample, all the excel cells are exported with the corresponding tooltip values of the grid cells. The same can be customized as per the requirement.

C#:

private void button2_Click(object sender, EventArgs e)
{
    Syncfusion.GridExcelConverter.GridExcelConverterControl gecc = new Syncfusion.GridExcelConverter.GridExcelConverterControl();
    gecc.QueryImportExportCellInfo += new GridImportExportCellInfoEventHandler(gecc_QueryImportExportCellInfo);
    //converting the grid to excel
        gecc.GridToExcel(this.gridControl1.Model, saveFileDialog.FileName);
}
private void gecc_QueryImportExportCellInfo(object sender, GridImportExportCellInfoEventArgs e)
{
    IRange range = e.ExcelCell;
    //grid tooltip value has been assigned to excel cell value.
    range.Value = e.GridCell.CellTipText.ToString();
    e.Handled = true;
}

 

VB:

Private Sub button2_Click(ByVal sender As Object, ByVal e As EventArgs)
                Dim gecc As New Syncfusion.GridExcelConverter.GridExcelConverterControl()
                AddHandler gecc.QueryImportExportCellInfo, AddressOf gecc_QueryImportExportCellInfo
                'converting the grid to excel
                                gecc.GridToExcel(Me.gridControl1.Model, saveFileDialog.FileName)
End Sub
Private Sub gecc_QueryImportExportCellInfo(ByVal sender As Object, ByVal e As GridImportExportCellInfoEventArgs)
                Dim range As IRange = e.ExcelCell
                'grid tooltip value has been assigned to excel cell value.
                range.Value = e.GridCell.CellTipText.ToString()
                e.Handled = True
End Sub

 

 

 

Sample

C#: Export ToolTip

VB: Export ToolTip

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