DataModelChanged + NumberCellType problem

Posted by: loy-chan on 8 September 2017, 1:17 pm EST

  • Posted 8 September 2017, 1:17 pm EST

    I having a problem with the NumberCellType column and the DataModelChanged event. I understand the basic principle behind this event but I'm wondering how exactly is the spread determining if a cell value is different than the data model value.


    I found the following situations while using the NumberCellType:


    1. If the cell is empty to start, and I enter edit mode, change nothing, and then exit edit mode. The DataModelChanged event does NOT fire as expected. I'm guessing that the cell value and data model are both null.


    2. If the cell has a value and I enter edit mode, change nothing, and then exit edit mode, The DataModelChanged event DOES fire. I'm guessing the value returned by the editor is different in some way from the data model.


    How can i prevent the DataModelChanged event from firing in the 2nd situation?


    Thanks


    Loy

  • Replied 8 September 2017, 1:17 pm EST

    After some debugging, I found out that the NumberCellType stores it datamodel value as a double. So once I converted my input value to double when I set the cell value ... poof, no more DataModelChanged event.


    Solves the problem now but is this an oversight?

  • Replied 8 September 2017, 1:17 pm EST

    Hello,


    This is correct behavior. If you have a double 4.0 in a cell and after going into and out of editmode, you return a decimal 4.0 or integer 4 to the DataModel, the DataModelChanged event should fire since the data in the datamodel would have been changed.

Need extra support?

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

Learn More

Forum Channels