0

如标题所述,从 radgrid 导出数据时,它会将所述数据导出到 pdf/excel 文档中的超链接。但是,当导出到 csv/word 时,它会将其导出为纯文本。

下面是我的网格的声明,其中包含用于导出数据的所有设置

<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>

在调用执行导出命令的实际函数时,我有:

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();
        }
    }
4

1 回答 1

0

事实证明,这些列被设置为gridtemplatecolumn而不是 using gridboundcolumn,这反过来又导致了超链接导出

于 2014-01-28T13:21:08.610 回答