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
  • 469350
    Offline posted

    Hi,

    It's hard to say without knowing what exactly is causing the exception. What's the DataType of the column?

    I doubt there's much you can do to avoid the exception on your end, other than what you suggested about providing a default value. But the grid should really avoid exceptions whenever possible, and if this is something that we can detect, we should fix this in the grid. Can you post a small sample project demonstrating the exception so we can check it out?

Reply
  • 920
    posted in reply to Mike Saltzman

     

     

    Figured out how to reproduce the issue.  Basically the grid System.FormatExceptions all over the place if you feed it empty strings on a Time column type

Children