Change event cannot be triggered when setting the cellvalue with code

Posted by: malishin on 21 July 2020, 4:39 pm EST

    • Post Options:
    • Link

    Posted 21 July 2020, 4:39 pm EST

    In the following two scenarios, Change event cannot be triggered

    1.setting the cellvalue with code

    2.For formula cells, when the value of the referenced cell in the formula changes

    Is there an event that can be triggered when the cell value changes in all above situations? We need to monitor any changes in the value of the cell

  • Posted 22 July 2020, 11:33 pm EST

    Hi,

    I would suggest you to try the CellChanged event. This event fires when there is any change in the cell like value change via code, edit, copy, paste, delete etc that makes the cell to repaint.

    Please go through the documentation link for the same: https://www.grapecity.com/spreadnet/docs/v13/online-win/FarPoint.Win.Spread~FarPoint.Win.Spread.SheetView~CellChanged_EV.html?highlight=cellchanged%2C

    Regards,

    Ruchir

  • Posted 2 August 2020, 4:43 pm EST

    Thanks , Ruchir. It works

    one more question, Is there an Event can be triggered when a formula cell’s value changed, It caused by the reference cell’s value change.

    for example : A5=Sum(A1:A4),when A1’s value changing, A5’s value also will change.

  • Posted 4 August 2020, 12:46 am EST

    Hello,

    You can set the AutoCalculcation property of spread to true to achieve your requirement.

    Thanks,

    Mohit

  • Posted 2 September 2020, 9:36 pm EST

    Hi, Mohitg

    still can’t work.

    I have attached a sample to illustrate the problem

    WindowsFormsApp24.zip

  • Posted 3 September 2020, 6:02 pm EST

    Hello,

    It is working at my end with your sample. Please share build number that you are using at your end.

    Also, please explain if I am missing something at my end.

    Thanks,

    Mohit

    vid_Fromula.zip

  • Posted 6 September 2020, 12:36 pm EST

    Hi mohitg,

    in Form1.cs of this program,you can see the following code

    fpSpread1.ActiveSheet.SetFormula(2, 0, "A1+A2");
                fpSpread1.ActiveSheet.SetFormula(2, 1, "SUM(A1:D1)");
    
    

    when A1’s value changed,A3 and B3 also will change.

    But these two cells did not trigger any change event

  • Posted 6 September 2020, 4:30 pm EST

    Hello,

    You can look at the event argument, which has type SheetViewEventArgs. The class has 4 properties:

    Row

    Column

    RowCount

    ColumnCount

    The event represents cell change for a range of cells but not a single cell.

    CellChange. It does not fire for each cell. Also, there is no event which fire on each cell.

    Hope it clarifies.

    Thanks,

    Mohit

  • Posted 6 September 2020, 4:30 pm EST

    Hello,

    You can look at the event argument, which has type SheetViewEventArgs. The class has 4 properties:

    Row

    Column

    RowCount

    ColumnCount

    The event represents cell change for a range of cells but not a single cell.

    CellChange. It does not fire for each cell. Also, there is no event which fire on each cell.

    Hope it clarifies.

    Thanks,

    Mohit

Need extra support?

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

Learn More

Forum Channels