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
920
System.FormatExpression being thrown on empty formatted text
posted

Infragistics is throwing and catching a System.FormatExpression every time a cell/column has no data in a formatted cell.  Here's some code:

                              column.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Time;
                              column.Format = "hh:mm";
                              column.MaskInput = "hh:mm";
                              column.CellDisplayStyle = CellDisplayStyle.FormattedText;
                              column.MaxLength = 5;

 The problem is I have 6 columns that are being accessed and throwing exceptions during any event like clickcell or onmouseover.  This is slowing down the program.

Is there a way to fix this other than having to set all my values to some default acceptable values?

Parents
No Data
Reply
  • 69832
    Offline posted

    I don't think you are supposed to use the 'FormattedText' setting unless you have rich text in the cells, i.e., HTML-like values that format the content with bolding, coloring, etc. The term 'format' in that setting does not mean formatting in the same context as the Format property. You should probably just not set the CellDisplayStyle property.

    Wrong I was, the 'FormattedText' setting for CellDisplayStyle and the Format property are related.

Children
  • 920
    posted in reply to Brian Fallon

    the column is a string...

    hovering over and clicking #1 Time cell:

    makes this happen in the immediate window.

     

    first chance exception of type 'System.FormatException' occurred in mscorlib.dll

    A first chance exception of type 'System.FormatException' occurred in mscorlib.dll

    ...

    A first chance exception of type 'System.FormatException' occurred in mscorlib.dll

     

     

    I'm going to see if there's anywhere i can step through and see if I can't write up a small project that reproduces the error.