Hello Guys,
I am trying to set the filename of my exported excel file but I am still getting the default filename "RadGridExport". Am I missing something?
<telerik:RadGrid ID="myRadGrid" CssClass="AutoShrink" runat="server" GridLines="Both" OnItemCommand="myRadGrid_ItemCommand">
<HeaderStyle Font-Bold="True" HorizontalAlign="Center" Wrap="True" />
</telerik:RadGrid>
Public Sub btnExport_Click(ByVal sender As Object, ByVal args As EventArgs)
myRadGrid.MasterTableView.ExportToExcel()
End Sub
Protected Sub myRadGrid_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles myRadGrid.ItemCommand
If e.CommandName = Telerik.Web.UI.RadGrid.ExportToExcelCommandName Then
myRadGrid.ExportSettings.ExportOnlyData = True
myRadGrid.ExportSettings.IgnorePaging = True
myRadGrid.ExportSettings.OpenInNewWindow = True
myRadGrid.ExportSettings.FileName = "myFilename"
End If
End Sub
Any help is appreciated.
Thanks!
I am trying to set the filename of my exported excel file but I am still getting the default filename "RadGridExport". Am I missing something?
<telerik:RadGrid ID="myRadGrid" CssClass="AutoShrink" runat="server" GridLines="Both" OnItemCommand="myRadGrid_ItemCommand">
<HeaderStyle Font-Bold="True" HorizontalAlign="Center" Wrap="True" />
</telerik:RadGrid>
Public Sub btnExport_Click(ByVal sender As Object, ByVal args As EventArgs)
myRadGrid.MasterTableView.ExportToExcel()
End Sub
Protected Sub myRadGrid_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles myRadGrid.ItemCommand
If e.CommandName = Telerik.Web.UI.RadGrid.ExportToExcelCommandName Then
myRadGrid.ExportSettings.ExportOnlyData = True
myRadGrid.ExportSettings.IgnorePaging = True
myRadGrid.ExportSettings.OpenInNewWindow = True
myRadGrid.ExportSettings.FileName = "myFilename"
End If
End Sub
Any help is appreciated.
Thanks!