将标题行添加到 RadGrid 导出的 Excel 工作表
我想将标题行添加到从 Rad 网格导出的文件中。我该怎么做?
<telerik:RadGrid ID="RadGridHist" runat="server" DataSourceID="SqlDataSourceHist" Visible="false"
AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true" OnPageIndexChanged="RadGridHist_PageIndexChanged"
OnPageSizeChanged="RadGridHist_PageSizeChanged" OnItemCommand="RadGridHist_ItemCommand" OnSortCommand="RadGridHist_SortCommand"
OnGridExporting="RadGridHist_GridExporting" OnExcelMLExportStylesCreated="RadGridHist_ExcelMLExportStylesCreated" AllowFilteringByColumn="true" OnInit="RadGridHist_Init"
Skin="Windows7">
<ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" HideStructureColumns="true" >
<Excel Format="Html" />
</ExportSettings>
<MasterTableView CommandItemDisplay="Top" >
<Columns>
//stuff
</Columns>
<CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowRefreshButton="false"
ExportToExcelText="Export To Excel Spreadsheet" />
</MasterTableView>
</telerik:RadGrid>
I would like to add a Title row to an exported File from a Rad Grid. How can I do this?
<telerik:RadGrid ID="RadGridHist" runat="server" DataSourceID="SqlDataSourceHist" Visible="false"
AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true" OnPageIndexChanged="RadGridHist_PageIndexChanged"
OnPageSizeChanged="RadGridHist_PageSizeChanged" OnItemCommand="RadGridHist_ItemCommand" OnSortCommand="RadGridHist_SortCommand"
OnGridExporting="RadGridHist_GridExporting" OnExcelMLExportStylesCreated="RadGridHist_ExcelMLExportStylesCreated" AllowFilteringByColumn="true" OnInit="RadGridHist_Init"
Skin="Windows7">
<ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" HideStructureColumns="true" >
<Excel Format="Html" />
</ExportSettings>
<MasterTableView CommandItemDisplay="Top" >
<Columns>
//stuff
</Columns>
<CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowRefreshButton="false"
ExportToExcelText="Export To Excel Spreadsheet" />
</MasterTableView>
</telerik:RadGrid>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需将 Item 命令的标题添加到 RadGrid 即可。感谢所有精彩的答案!哈哈。
Just add a caption on Item command to the RadGrid. Thanks for all the wonderful answers! haha.