Hi
I am working on excel export\import in webdatagrid.I want to add a text "Please Note: Do Not Update Columns A - B! Only data in column C will be imported! \nBefore beginning, select all cells with a green triangle, right click, and select 'Convert to Number'" at the top row as shown in attached image.I am not able to do so.My code is
protected void btnExportToExcel_Click(object sender, EventArgs e) {
BindStatisticData(); logutils.createLogEntry(1, "Statistics Export for MI: " + currentMI.modelInstanceID, loggedInUserID); Infragistics.Documents.Excel.Workbook workbook = new Infragistics.Documents.Excel.Workbook(); workbook.Worksheets.Add(currentMI.modelInstanceID.ToString().Substring(0, 31).Replace("-", "")); workbook.Worksheets[0].Rows[0].Cells[0].Value = "Please Note: Do Not Update Columns A - B! Only data in column C will be imported! \nBefore beginning, select all cells with a green triangle, right click, and select 'Convert to Number'."; Response.ClearHeaders(); WebExcelExporter1.Export(dgCompanyStats, workbook);
//UltraWebGrid1.Bands[0].Columns[1].Hidden = false; //UltraWebGrid1.Bands[0].Columns[6].Hidden = false; //UltraWebGrid1.Bands[0].Columns[7].Hidden = false; //UltraWebGrid1.Bands[0].Columns[8].Hidden = false; //UltraWebGrid1.Bands[0].Columns[9].Hidden = false;
}
Please help how to do this?
Hello,
Thank you for contacting Infragistics!
You can achieve this by using one of the over rides for the export method of the WebExcelExporter that lets you set the row and column offsets:
Export single grid to worksheet:http://help.infragistics.com/doc/ASPNET/2015.1/CLR4.0/?page=Infragistics4.Web.v15.1~Infragistics.Web.UI.GridControls.WebExcelExporter~Export(WebDataGrid,Worksheet,Int32,Int32).html
Export multiple grids to separate worksheets:http://help.infragistics.com/doc/ASPNET/2015.1/CLR4.0/?page=Infragistics4.Web.v15.1~Infragistics.Web.UI.GridControls.WebExcelExporter~Export(Workbook,Int32,Int32,WebControl[]).html
Export multiple grids to a single worksheet:http://help.infragistics.com/doc/ASPNET/2015.1/CLR4.0/?page=Infragistics4.Web.v15.1~Infragistics.Web.UI.GridControls.WebExcelExporter~Export(Worksheet,Int32,Int32,WebControl[]).html
Please let me know if you have any further questions concerning this matter.