Hi,
I've got a problem with ToExcelML() extension method for RadGridView, I tried the other method of ToCSV which is working fine.
Code Behind
XAML
The column definition is being generated on the fly inside the async_completed of WCF.
The error that I'm getting is "Specified cast is not valid".
I've got a problem with ToExcelML() extension method for RadGridView, I tried the other method of ToCSV which is working fine.
Code Behind
Dim dialog As New SaveFileDialog() With {.Filter = "EXCEL files (*.xls)|*.xls|All files (*.*)|*.*"} |
If dialog.ShowDialog() = True Then |
Using stream As Stream = dialog.OpenFile() |
Using writer As New StreamWriter(stream, Encoding.UTF8) |
writer.Write(dgResults.ToExcelML()) |
End Using |
stream.Close() |
End Using |
End If |
Private Sub ExportResults_Exporting(ByVal sender As Object, ByVal e As Telerik.Windows.Controls.GridViewExportEventArgs) Handles dgResults.Exporting |
'Change the font size and the background color of the table header only |
If (e.Element = ExportElement.HeaderRow Or e.Element = ExportElement.HeaderCell) Then |
e.FontSize = e.FontSize + 4 |
e.Background = Colors.DarkGray |
'Change the font size and the background color of the group headers only |
ElseIf (e.Element = ExportElement.GroupHeaderCell Or e.Element = ExportElement.GroupHeaderRow) Then |
e.FontSize = e.FontSize + 2 |
e.Background = Colors.LightGray |
End If |
End Sub |
XAML
<telerikGrid:RadGridView x:Name="dgResults" Canvas.Left="-1500" Grid.Row="1" |
Grid.Column="0" AutoGenerateColumns="False" Exporting="ExportResults_Exporting" CanUserFreezeColumns="False"></telerikGrid:RadGridView> |
The column definition is being generated on the fly inside the async_completed of WCF.
The error that I'm getting is "Specified cast is not valid".