How to programatically raise the EditChange event?

Posted by: ghr on 8 September 2017, 1:36 pm EST

  • Posted 8 September 2017, 1:36 pm EST

    Hi, I recently upgraded the Spread control from COM to .NET version. In the COM version I could programatically call the EditMode event using something like this:

    vaSpread1_EditMode(2, 9, vaSpread1(2).MaxRows, 0, True) 'Simulate event raised by user

    As I'm migrating to a .NET enviroment, I want to programatically raise this event, but I'm somehow confused as I'm not too familiarized yet with this version or .NET. How to proceed?

    Thanks in advance.


  • Replied 8 September 2017, 1:36 pm EST


    All you need to do is to call the function that implements the event and pass the correct parameters.

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim eSend As New System.EventArgs

    FpSpread1_EditModeOn(FpSpread1, e)

    End Sub

    Private Sub FpSpread1_EditModeOn(ByVal sender As Object, ByVal e As System.EventArgs) Handles FpSpread1.EditModeOn

    End Sub

  • Replied 8 September 2017, 1:36 pm EST

    Thanks for your answer. Based on your input, as I understood, I'm trying the following:


    Dim e As New FarPoint.Win.Spread.EditorNotifyEventArgs( ??,  FpSpread0,  FpSpread0.Sheets(0).RowCount,  8) ' <- Confused about constructor

    FpSpread0_EditChange(FpSpread0, e)


    I'm struggling with the argument constructor, acording to documentation first constructor parameter is a View, the second one an editingControl, and the last ones the row and column.

    What is the correct object to pass on first parameter?

    In the second one I'm passing the spread control FpSpread0 itself, it is correct?

    Thanks in advance. 


  • Replied 8 September 2017, 1:36 pm EST

    One of the correct ways would be the following...

    Dim eh As New FarPoint.Win.Spread.EditorNotifyEventArgs(FpSpread1.GetRootWorkbook, FpSpread1.EditingControl, 1, 1)
    FpSpread1_EditChange(FpSpread1, eh)

Need extra support?

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

Learn More

Forum Channels