0
正如標題所述,當從radgrid導出數據時,它將所述數據導出到pdf/excel文檔中的超鏈接。但是,導出爲csv/word時,會將其作爲純文本輸出。Radgrid導出數據作爲pdf/excel的超鏈接
下面是我的網格與用於導出數據
<telerik:RadGrid ID="grdSummary" runat="server" AllowSorting="True"
AutoGenerateColumns="False" CellSpacing="0" GridLines="None"
height="150px" Width="99%" OnItemCommand="grdSummary_ItemCommand" >
<clientsettings allowcolumnsreorder="True" reordercolumnsonclient="True">
<selecting allowrowselect="True" /><scrolling allowscroll="true"
usestaticheaders="false" />
</clientsettings>
<ExportSettings HideStructureColumns="true"></ExportSettings>
<mastertableview Width="100%" CommandItemDisplay="Top">
<CommandItemSettings ShowExportToWordButton="true" ShowExportToCsvButton="true"
ShowExportToPdfButton="true" ShowExportToExcelButton="true"
ShowAddNewRecordButton="False" ShowRefreshButton="False">
</CommandItemSettings>
而且所有設置的宣言,呼籲實際功能執行export命令的時候,我有:
protected void grdSummary_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToCsvCommandName)
{
grdSummary.MasterTableView.ExportToCSV();
}
if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToWordCommandName)
{
grdSummary.MasterTableView.ExportToWord();
}
if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToPdfCommandName)
{
grdSummary.MasterTableView.ExportToPdf();
}
if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToExcelCommandName)
{
grdSummary.MasterTableView.ExportToExcel();
}
}