Parent.RecalculateAll

Posted by: Bryan.Graves on 11 July 2019, 6:08 am EST

    • Post Options:
    • Link

    Posted 11 July 2019, 6:08 am EST

    We are upgrading our spread to the newest version. A problem we are experiencing is with Sheetview.Parent.RecalculateAll after editing a cell in the childview row. It is giving a System.Exception within the spread internal code.

    System.Exception: Exception handled in FpSpread.WndProc —> System.NullReferenceException: Object reference not set to an instance of an object.

    at FarPoint.Win.Spread.SpreadView.a(Control A_0)

    at FarPoint.Win.Spread.SpreadView.dj()

    at FarPoint.Win.Spread.SpreadView.ah(Boolean A_0)

    at FarPoint.Win.Spread.SpreadView.o(Object A_0, EventArgs A_1)

    at FarPoint.Win.Spread.CellType.BaseCellType.FireEditingStopped()

    at FarPoint.Win.Spread.CellType.EditBaseCellType.StopEditing()

    at FarPoint.Win.Spread.SpreadView.aj(Boolean A_0)

    at FarPoint.Win.Spread.SpreadView.StopCellEditing()

    Here is simple code to recreate…

    Create a Form with FpSpread(12.45.20191.0), insert the following code, and run.

    1. Open a row to create a childview.
    2. Edit the Name cell.
    
    Imports FarPoint.Win.Spread
    
    Public Class Form1
       Private WithEvents BindingSource As New BindingSource
       Private Tests As New List(Of TestClass)
    
       Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
          LoadForm()
       End Sub
    
       Private Sub LoadForm()
          Tests.Add(New TestClass(1, New List(Of TestClass2)({New TestClass2("Name1")})))
          Tests.Add(New TestClass(2, New List(Of TestClass2)({New TestClass2("Name2")})))
          Tests.Add(New TestClass(3, New List(Of TestClass2)({New TestClass2("Name3")})))
    
          BindingSource.DataSource = Tests
    
          FpSpread1_Sheet1.ColumnCount = 2
          FpSpread1_Sheet1.DataSource = BindingSource
    
          FpSpread1_Sheet1.Columns(0).DataField = "Id"
          FpSpread1_Sheet1.Columns(1).DataField = "Stuff"
          FpSpread1_Sheet1.Columns(1).Visible = False
       End Sub
    
       Private Sub FpSpread1_ChildViewCreated(sender As Object, e As ChildViewCreatedEventArgs) Handles FpSpread1.ChildViewCreated
          With e.SheetView
             .ColumnCount = 1
             .Columns(0).DataField = "Name"
             .Columns(0).CellType = New FarPoint.Win.Spread.CellType.TextCellType
          End With
       End Sub
    
       Private Sub FpSpread1_EditModeOff(sender As Object, e As EventArgs) Handles FpSpread1.EditModeOff
          Dim sheetView As FarPoint.Win.Spread.SheetView = FpSpread1.GetRootWorkbook.GetActiveWorkbook.Sheets(0)
    
          If sheetView IsNot Nothing _
          AndAlso sheetView.Parent IsNot Nothing Then
             sheetView.Parent.RecalculateAll()
          End If
       End Sub
    
       Public Class TestClass
          Public Property Id As String
          Public Property Stuff As List(Of TestClass2)
    
          Sub New(ByVal id As Integer, ByVal stuff As List(Of TestClass2))
             Me.Id = id
             Me.Stuff = stuff
          End Sub
       End Class
       Public Class TestClass2
          Public Property Name As String
    
          Sub New(ByVal name As String)
             Me.Name = name
          End Sub
       End Class
    End Class
    
    
    
  • Posted 15 July 2019, 5:19 pm EST

    Hi,

    Thanks for the sample code. We’ve asked the developers to look into this issue [Internal Tracking ID: 274182]. We’ll let you know as soon as we get any information from them.

    Also, can you please mention your previous Spread version (where this worked correctly)?

    Regards,

    Jitender

  • Posted 18 July 2019, 12:33 am EST

    Version=7.0.3502.2008

  • Posted 18 July 2019, 5:41 pm EST

    Thanks for the info.

    The developers have determined it to be a bug. I’ll update this thread when a fix for this is available.

  • Posted 12 August 2019, 6:14 pm EST

    Hi,

    This issue has been fixed in the latest release (Spread 12 SP2).

    You can download the latest builds from here: https://www.grapecity.com/download/spreadnet

    Regards,

    Jitender

Need extra support?

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

Learn More

Forum Channels