How to make change to the datarow without clicking

Posted by: miyoung on 8 September 2017, 12:54 pm EST

  • Posted 8 September 2017, 12:54 pm EST

    Hi, I’m using Farpoint Spread for windows forms v2.5 with vs2005 (visual basic).


     


    I’ve bound Dataset to the spread using the DataSource Property. When I’ve changed the data on the cell directly after the clicking, there is no problem. But if I’ve set the value to the spread programmatically, the status of the DataRow is not changed to ‘Modified’. In addition to that, when using DragFill Function (AllowDragFill=True), I have the same problem.


    I’ve already called ‘EditEnd’ after changing the value programmatically, but the result is the same as before. The status of DataRow is never changed.


     


    So, how to make the changes to the DataRow without the clicking?

  • Replied 8 September 2017, 12:54 pm EST

    Hello,


    How are you calling EditEnd? The method you need to call is EndEdit. This is a method on the DataRow that is bound to the row you are changing in the Spread control.

  • Replied 8 September 2017, 12:54 pm EST

    Sorry, I called EndEdit as follows. But after updating, changes were not applied to the database. Please let me know how to call EndEdit correctly.


            With grdCols.Sheets(0)
                Dim model As New FarPoint.Win.Spread.Model.DefaultSheetDataModel
                Dim r As DataRow
                model = CType(.Models.Data, FarPoint.Win.Spread.Model.DefaultSheetDataModel)


                For i As Integer = 0 To .RowCount - 1
                    .SetValue(i, 4, i)
                    r = model.GetDataRow(i).Row
                    r.EndEdit()
                Next
            End With


     


     

  • Replied 8 September 2017, 12:54 pm EST

    Looks to me like you are calling the EndEdit on the DataRow of the model of the spread.  You need to call it on DataRow itself of the DataSource.  It isn't in the model of the spread as of yet.
  • Replied 8 September 2017, 12:54 pm EST

    Hello,


    This code looks correct and works in my tests. Could you post a small zipped project reproducing the issue you are seeing for us to debug?

  • Replied 8 September 2017, 12:54 pm EST

    Sorry, now I'm using 'GetDataRowFromModelRow' instead just Row, then it works correctly. Thanks for all your support. And I'll try to use this EndEdit for DragFill also.

Need extra support?

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

Learn More

Forum Channels