When I use Infragistics.Excel to create a grid and enter 0052 into cell it gets a number formatted to text warning on the cell.
How do I set the cell or column format to Text rather than General to get rid of the error???
Hi Claudio,
You can use the FormattedString to apply styles to portions of the text. Take a look at the following links where it is explained (specifically item k.)
Applying Styles to Cell
http://help.infragistics.com/NetAdvantage/WinForms/2010.2/CLR2.0/?page=ExcelEngine_Applying_Styles_to_Cells.html
Excel.FormattedString
http://help.infragistics.com/NetAdvantage/WinForms/2010.2/CLR2.0/?page=Infragistics2.Excel.v10.2~Infragistics.Excel.FormattedString.html
Let me know if you have further questions.
Marianne
Developer Support Engineer Infragistics
Hello Haessd,
haessd said:How do I set the cell or column format to Text rather than General to get rid of the error???
I`m not sure that I understand well your issue, but if you export your grid`s content into Excel, you could specify your CellFormat using for example the code below:
private void ultraGridExcelExporter1_CellExporting(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.CellExportingEventArgs e) { e.CurrentWorksheet.Rows[e.CurrentRowIndex].Cells[3].CellFormat.FillPatternBackgroundColor = Color.Red; e.CurrentWorksheet.Rows[e.CurrentRowIndex].Cells[3].CellFormat.FormatString = "@"; // Text }
Let me know if you think that I misunderstand your question.
Regards
Have you been able to resolve your issue ? If you still have any concerns or questions I will be glad to help. If you need any additional assistance don’t hesitate to ask.