How to capture changed values from web spread?

Posted by: szilbermints on 6 February 2019, 7:10 am EST

  • Posted 6 February 2019, 7:10 am EST


    I need to create a change log, in other words capture all old and all new values for all changed rows.
    I can do it via DataSet changedRows properies
    (inDS.Tables(0).GetChanges(System.Data.DataRowState.Modified) looping thru those

    But I wonder if there is is a way to do it via some WebSpread attributes directly?

    Thank You

  • Replied 6 February 2019, 11:57 pm EST


    You can get the updated values in the UpdateCommand event server side:

    Deepak Sharma
  • Replied 7 February 2019, 3:35 am EST

    Thank You Deepak,

    Couple of things.

    1. I have multiple page output and it looks like it gets triggered when i move to another page
    I d rather have when user clicks "Save" button

    2.It s still not clear how to get "old" and "new" Values? The only thing i could see was "editvalues" array containing one new value

    Thank You

  • Replied 7 February 2019, 10:02 pm EST


    1. Changing the page or sheet will cause a postback. This is the default behavior.

    2. UpdateCommand event fires for each data row and you can get the updated value with
    e.EditValues array and the old value can be fetched with

    fpspread1.ActiveSheetView.Cells[0, e.CommandArgument)

    Deepak Sharma

  • Replied 14 February 2019, 6:54 am EST

    Thank You Deepak,

    I can get this array via code you provided or via DataSet.
    The strange thing is that if user clicks into another cell on a different row but does not cahnge it it still reports as Changed Record although when i check it's clearly the same value:

    "a" {String}
    String: "a"
  • Marked as Answer

    Replied 14 February 2019, 6:25 pm EST


    Update event is fired for each changed row whereas only the cells which has changed data shows the value in EditValues array.
    You can check for unchanged status of the edited values, as shown in the code below in UpdateCommand event:

    Dim sv As FarPoint.Web.Spread.SheetView = e.SheetView
    For i = 0 To sv.ColumnCount - 1
    If (Not e.EditValues.Item(i) Is FarPoint.Web.Spread.FpSpread.Unchanged) Then
    updateCmd.Parameters(colName).Value = e.EditValues.Item(i)
    End If
Need extra support?

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

Learn More

Forum Channels