gpt4 book ai didi

c# - Telerik Radgrid 导出文件名

转载 作者:太空狗 更新时间:2023-10-29 21:35:18 25 4
gpt4 key购买 nike

有谁知道如何在 Telerik RadGrid 中为导出的文件提供文件名,导出的文件可以是任何格式的pdf、excel或word

最佳答案

来源:Grid / MS Excel/MS Word/CSV

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

发件人:When to set 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";
}
}

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

关于c# - Telerik Radgrid 导出文件名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11012161/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com