Using the SpreadStreamExport feature of RadGridView doesn't work as expected when exporting DateTime objects. It exports the dates as String values which prevents the date-related features (like formatting) to work in Excel.
To work this around, you can create a custom SpreadStreamExportRenderer and override its SetCellValue method. This will allow you to manually provide the DateTime object instead of the string.
public class MyRenderer : SpreadStreamExportRenderer
{
public override void SetCellValue(DataType dataType, object value)
{
DateTime date;
if (value != null && DateTime.TryParse(value.ToString(), out date))
{
base.SetCellValue(DataType.DateTime, date);
var cell = this.GetCell() as ICellExporter;
cell.SetFormat(new SpreadCellFormat() { NumberFormat = "yyyy-MM-dd HH:mm:ss" });
return;
}
base.SetCellValue(dataType, value);
}
}
spreadStreamExport.RunExportAsync(FILENAME, new MyRenderer(), options);
The TableCellProperty.Padding property of the "TableNormal" StyleDefinition doesn't take effect in the UI. The same is valid for the TableProperties.CellPadding property.
To work this around, you can manually set the Padding property of all TableCell elements in the RadDocument.
var cells = radDocument.EnumerateChildrenOfType<Telerik.Windows.Documents.Model.TableCell>();
foreach (var cell in cells)
{
cell.Padding = new Padding(10);
}
The image adorner in is not shown in NetCore/6/7/8 when ApplicationTheme is not set (XAML only).
Workaround:
Explicitly set the theme:
StyleManager.ApplicationTheme = new Office2016Theme();