でエクスポートされfile name
たファイルに提供する方法を知っている人はいますか?Telerik RadGrid
11319 次
2 に答える
5
出典:グリッド / MS Excel/MS Word/CSV
作成されるファイルの名前 (拡張子なし) を指定する文字列である RadGrid.ExportSettings.FileName プロパティを使用します。ファイル拡張子は、使用されるメソッドに基づいて自動的に追加されます。以下に示すよう
FileName
に、ItemCommand
イベントで を設定してみてください。
From: 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";
}
}
于 2012-06-13T09:58:40.690 に答える
1
ファイル名やその他のエクスポート オプションは、ExportSettings
( ではなく) グリッドのプロパティで設定できますMasterTableView
。たとえば、次のようになります。
myGrid.ExportSettings.FileName = "file";
myGrid.ExportSettings.Excel.Extension = "xls";
myGrid.MasterTableView.ExportToExcel();
于 2012-06-13T09:47:42.103 に答える