views:

236

answers:

1

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

Just add a caption on Item command to the RadGrid. Thanks for all the wonderful answers! haha.

RadGridHist.MasterTableView.Caption = "Title";
Eric