Hi- I'm having trouble with exporting grid contents to Excel- using winforms radgridview version 2018.1.220.40 in vb.net. (Hopefully this is a stupid question but I've spent an hour looking through documentation and I think I'm missing something.) I found the code snippet below in the documentation, but getting the error
gridViewExport is not defined, and gridviewExportOptions not defined...
I'm assuming that gridViewExport is supposed to be my radgridview object, but when I sub in the name of mine, it says 'export' is not a member of RadGridView...
Can you advise? Thanks very much.
-----------------------------------------
https://docs.telerik.com/devtools/wpf/controls/radgridview/export/export
Private Sub btnExport_Click(sender As Object, e As RoutedEventArgs)
Dim extension As String = "xls"
Dim dialog As New SaveFileDialog() With {
.DefaultExt = extension,
.Filter = String.Format("{1} files (.{0})|.{0}|All files (.)|.", extension, "Excel"),
.FilterIndex = 1
}
If dialog.ShowDialog() = True Then
Using stream As Stream = dialog.OpenFile()
gridViewExport.Export(stream, New GridViewExportOptions() With {
.Format = ExportFormat.Html,
.ShowColumnHeaders = True,
.ShowColumnFooters = True,
.ShowGroupFooters = False
})
End Using
End If
End Sub