RadGrid
exportGrid = new RadGrid();
exportGrid.NeedDataSource +=
new GridNeedDataSourceEventHandler( exportGrid_NeedDataSource );
exportGrid.Skin =
"Default";
exportGrid.Width = Unit.Percentage( 100 );
exportGrid.ShowHeader = false;
exportGrid.AutoGenerateColumns = true;
exportGrid.ExportSettings.ExportOnlyData = true;
exportGrid.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
exportGrid.DataMember = "ExportData";
PlaceHolder phExport = new PlaceHolder();
currentPage.Controls.Add( phExport );
exportGrid.DataSource = _exportData;
phExport.Controls.Add( exportGrid );
exportGrid.Rebind();
foreach ( GridHeaderItem headerItem in exportGrid.MasterTableView.GetItems( GridItemType.Header ) )
headerItem.Visible = false;
exportGrid.MasterTableView.ExportToExcel();
I also tried a couple of different variations on this approach, without any luck:
protected
void exportGrid_ExcelMLExportRowCreated( object source, Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowCreatedArgs e ){
if ( e.RowType == Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowType.HeaderRow ){
foreach ( Telerik.Web.UI.GridExcelBuilder.CellElement cell in e.Row.Cells ){
if( cell.Data != null )
cell.Data.DataItem = null;
}
}
}
Any help is appreciated.