Problem with cell value not displaying

Posted by: sassanow on 8 September 2017, 1:04 pm EST

  • Posted 8 September 2017, 1:04 pm EST

    I recently upgraded an app that was using v3 to v4.  Since that time I have noticed that some cells with formulas are not displaying the value of the cell.  The examples below have two adjacent cells Suming the same selected rows in their respective columns.


    ?e.Row & ", " & e.Column
    "304, 7"
    ?_Grid.Sheets(0).Cells(e.Row, e.Column).Value.ToString
    "26368384"
    ?_Grid.Sheets(0).Cells(e.Row, e.Column).Text
    ""
    While the cell next to the blank one (with basically the same formula) has no issues:


    ?e.Row & ", " & e.Column
    "304, 8"
    ?_Grid.Sheets(0).Cells(e.Row, e.Column).Value.ToString
    "754126"
    ?_Grid.Sheets(0).Cells(e.Row, e.Column).Text
    "$754,126.00"


    How is it possible for a cell to have a Value but the Text to be blank?  And how do I fix this?

  • Replied 8 September 2017, 1:04 pm EST

    Hello,


    The Text property is going to call the Format method of the CellType for the cell for format the data from the DataModel. The formatted data (Text) is what is displayed in the cell. My guess is the CellType has the MaximumValue property set lower than the value you have in the DataModel.

  • Replied 8 September 2017, 1:04 pm EST

    Scott,


    I was not explicitly setting the MaximumValue property in my code.  I did run a test with the code setting the MaximumValue property to 99999999999.99 and the value did display properly in the cell.  So I do consider this a work-around.  However, I would expect the MaximumValue property to default to the cell type's maximum value, unless I set to something else (as it appeared to do in version 3).  In this case the cell type is CurrencyCellType and it does not at this point appear to be happening on other cell types.


    Sounds like a bug to me...


  • Replied 8 September 2017, 1:04 pm EST

    Hello,


    It was a bug, but in the older version. It was not formatting the number correctly. The default setting for the MaximumValue property is 9999999.99. This is the way the CellType has been and is documented.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels