<
t:RadGridView
x:Name
=
"Logs"
>
<
t:RadGridView.Columns
>
<
t:GridViewDataColumn
CellTemplateSelector
=
"{StaticResource IconTemplateSelector}"
/>
<
t:GridViewDataColumn
DataMemberBinding
=
"{Binding LogLevel,Mode=OneWay}"
Header
=
"Level"
CellStyle
=
"{StaticResource PaddedCell}"
/>
<
t:GridViewDataColumn
DataMemberBinding
=
"{Binding LogID,Mode=OneWay}"
Header
=
"LogID"
/>
<
t:GridViewDataColumn
DataMemberBinding
=
"{Binding MachineDateTime,Mode=OneWay}"
Header
=
"Machine Time"
CellStyle
=
"{StaticResource PaddedCell}"
/>
<
t:GridViewDataColumn
DataMemberBinding
=
"{Binding Occured, Mode=OneWay}"
Header
=
"Occured"
CellStyleSelector
=
"{StaticResource ColorSelector}"
/>
<
t:GridViewDataColumn
DataMemberBinding
=
"{Binding System,Mode=OneWay}"
Header
=
"System"
CellStyle
=
"{StaticResource PaddedCell}"
/>
<
t:GridViewDataColumn
DataMemberBinding
=
"{Binding Mode,Mode=OneWay}"
Header
=
"Mode"
CellStyle
=
"{StaticResource PaddedCell}"
/>
<
t:GridViewDataColumn
DataMemberBinding
=
"{Binding CallingClass,Mode=OneWay}"
Header
=
"Calling Class"
CellStyle
=
"{StaticResource PaddedCell}"
/>
<
t:GridViewDataColumn
DataMemberBinding
=
"{Binding Message,Mode=OneWay}"
Header
=
"Message"
CellStyle
=
"{StaticResource PaddedCell}"
/>
<
t:GridViewDataColumn
DataMemberBinding
=
"{Binding Exception,Mode=OneWay}"
Header
=
"Exception"
CellStyle
=
"{StaticResource PaddedCell}"
/>
</
t:RadGridView.Columns
>
</
telerik:RadGridView
>
I have above data-bound RadGridView (named Logs) and I am trying to export its contents, but it always results into an empty exported file.
And I try to export the contents of RadGridView with below code:
private
void
ExportLogs()
{
using
(var stream = File.Create(filepath))
{
Logs.Export(stream,
new
GridViewExportOptions()
{
Format = ExportFormat.ExcelML,
ShowColumnHeaders =
true
,
ShowColumnFooters =
false
,
ShowGroupFooters =
false
,
});
}
}
Any help would be appreciated. Thank you.