-the order of the columns are from the dataset that the grid bind to, not the order of the columns displayed in the dataset
below are the code snipet:
protected void ImgExportExcel_Click(object sender, ImageClickEventArgs e)
{
rdgLUValue = ConfigureExcelExport(rdgLUValue);
bindLookupDataForExport();
rdgLUValue.MasterTableView.ExportToExcel();
}
public RadGrid ConfigureExcelExport(Telerik.Web.UI.RadGrid grdDataGrid)
{
grdDataGrid.ExportSettings.IgnorePaging = true;
//grdDataGrid.AllowPaging = false;
grdDataGrid.ExportSettings.ExportOnlyData = true;
grdDataGrid.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML;
return grdDataGrid;
}
private void bindLookupDataForExport()
{
if (BAtEase.Common.BAtEaseSession.LookupData != null)
{
rdgLUValue.DataSource = BAtEase.Common.BAtEaseSession.LookupData;
rdgLUValue.DataBind();
up.Update();
}
}
Please, help.Thanks.