yog*_*ogi 6 c# asp.net rad-controls telerik
有没有人知道如何提供file name导出的文件Telerik RadGrid,导出的文件可以是任何格式的pdf,excel或word
使用RadGrid.ExportSettings.FileName属性,该属性是一个字符串,指定将要创建的文件的名称(不带扩展名).根据使用的方法自动添加文件扩展名尝试
FileName在ItemCommand事件中设置,如下所示.
发件人:何时设置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";
}
}
Run Code Online (Sandbox Code Playgroud)
参考:
在启用Ajax的情况下将RadGrid内容导出为Excel/Word/CSV/PDF
| 归档时间: |
|
| 查看次数: |
10575 次 |
| 最近记录: |