Telerik Radgrid Export File Name

Does anyone know how to provide a file name exported file in Telerik RadGrid , the exported file can be in any pdf, excel or word format

+6
source share
2 answers

Source: Grid / MS Excel / MS Word / CSV

Use the RadGrid.ExportSettings.FileName property, a string specifying the name (without extension) of the file to be created. the file extension is automatically added based on the method used. Try setting FileName in the ItemCommand event, as shown below.

From: When to Install RadGrid.ExportSettings.FileName

 protected void Radgrid1_ItemCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == RadGrid.ExportToPdfCommandName) { Radgrid1.ExportSettings.FileName = "yourfilename"; } if (e.CommandName == RadGrid.ExportToExcelCommandName) { Radgrid1.ExportSettings.FileName = "yourfilename"; } if (e.CommandName == RadGrid.ExportToWordCommandName) { Radgrid1.ExportSettings.FileName = "yourfilename"; } } 

Reference:
Export RadGrid content to Excel / Word / CSV / PDF with Ajax enabled

+5
source

You can specify the file name, as well as other parameters for export, in the ExportSettings property of the grid (and not MasterTableView ). For example:

 myGrid.ExportSettings.FileName = "file"; myGrid.ExportSettings.Excel.Extension = "xls"; myGrid.MasterTableView.ExportToExcel(); 
+1
source

Source: https://habr.com/ru/post/917951/


All Articles