Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2430
Formatting Cells
posted

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???

Supposedly a sample was posted but can't get to the sample (will continue to investigate) - gives error on trying to open up the link...

 
[Infragistics] Marianne
Points 8,240

 
Replied On: Fri, Oct 15 2010 10:57 AM Reply
Verified by mtgc

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

 

Parents
No Data
Reply
  • 53790
    posted

    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

Children