New to Telerik UI for WPF? Start a free 30-day trial
Export String Value
Updated on Sep 15, 2025
PROBLEM
When exporting a RadGridView to Excel using ExportFormat.HTML, the string values that can be converted to numbers, are opened in Excel as numbers.
his behavior does not occur when exporting using ExportFormat.ExcelML.
CAUSE
When using the HTML format, the RadGridView actually saves data in an Excel readable html format.
SOLUTION
You will need to format the exported string column appropriately so that the Excel file interprets it as a string.
Here is a small sample code:
Example 1: Handling the ElementExporting event:
C#
private void clubsGrid_ElementExporting(object sender, GridViewElementExportingEventArgs e)
{
if (e.Element == ExportElement.Cell)
{
var column = e.Context as GridViewDataColumn;
if (column.Header.ToString() == "My String Column")
{
e.Value = string.Format(@"=T(""{0}"")", e.Value);
}
}
}