Skip to content

Commit

Permalink
keep your enums values in English & export in excel their description (
Browse files Browse the repository at this point in the history
  • Loading branch information
zjelev authored Jan 6, 2025
1 parent c7e4470 commit d6dd679
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions RadzenBlazorDemos.Host/Controllers/ExportController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ public FileStreamResult ToExcel(IQueryable query, string fileName = null)
if (value != null)
{
stringValue = Convert.ToString(value, CultureInfo.InvariantCulture);

if (value is Enum enumValue)
{
stringValue = Radzen.Blazor.EnumExtensions.GetDisplayDescription(enumValue);
}
}
cell.CellValue = new CellValue(stringValue);
cell.DataType = new EnumValue<CellValues>(CellValues.Number);
Expand Down

0 comments on commit d6dd679

Please sign in to comment.