GC.Spread.Sheets.Events.ValueChanged vs GC.Spread.Sheets.Events.RangeChanged

Posted by: philip.j.garbarino on 21 November 2022, 3:27 am EST

  • Posted 21 November 2022, 3:28 am EST

    I would think that if I wanted to get an event that had all value changes I would use the RangeChangedEvent, but it turns out sometimes the event only goes to ValueChanged. This is causing me to have to register both which causes other issues namely contention. We recently put a 5ms delay in one of the events to prevent this. This seems like a hack, shouldn’t RangeChanged handle all changes? Thanks Phil-

  • Posted 21 November 2022, 11:14 pm EST

    Hi,

    ValueChanged is triggered when the value in the subeditor changes, as the name implies. If you change the value of a cell, for example, ValueChanged is triggered.

    However, RangeChanged is triggered when the action has the potential to change a range. If you change a formula, for example, Range Changed is triggered because it may affect a range of cells. Similarly, because the dragFill operation affects a range, RangeChanged is triggered.

    You could also look for actions that cause the RangeChanged event to be raised.

    RangeChangedActionEnumeration:

    https://www.grapecity.com/spreadjs/api/enums/GC.Spread.Sheets.RangeChangedAction

    When you change the value of a cell from “Value1” to “Value2,” RangeChanged will not be triggered. ValueChanged will be triggered in this case. This is expected behavior and by design.

    I hope this helps to clarify your situation. Please let us know if you require any additional assistance with this matter. We would be delighted to assist you.

    Regards,

    Ankit

  • Posted 22 November 2022, 2:04 pm EST

    Hi Ankit,

    We are facing an issue with Range change event, for example you change the cell value from “Value1” to “Value2,” and value change sometimes registered under rangeChanged event and sometimes it doesn’t.

    When we try to use both event to capture all cell changes in the workbook (Value and range) we are losing the value change that happened on that particular cell due to race condition, both events trying to access the same change and its not working properly. As work around we delayed one of the events,

    But we want to know why this is happening?

    We are using spread JS version 15.0.0

    Getenet,

    Thanks

    JPMC

  • Posted 22 November 2022, 2:43 pm EST

    Hello Getenet,

    I tried the most recent SpreadJS V15.2.5 version, but I was unable to reproduce the problem on my end. Please give the most recent version a try.

    If the problem still exists for you, kindly provide a basic working sample that reproduces the problem. You might also change the sample below that was used for testing and send it to us. Include the steps you took as well.

    Sample: https://jscodemine.grapecity.com/share/F7_ypyU50kOsQzV4KV54fQ/

    Regards,

    Ankit

Need extra support?

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

Learn More

Forum Channels