Binding to DataView

Posted by: bobfisher on 8 September 2017, 1:52 pm EST

  • Posted 8 September 2017, 1:52 pm EST

    I just downloaded version 4.0 and was using an older version before.


    I'm having trouble when binding to a DataView.  After binding, if I try to set a cell value I get a null reference exception.  When I change to binding to the DataTable the null reference exception goes away.


    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


    Dim dt As New DataTable


    dt.Columns.Add("String", GetType(String))


    dt.Columns.Add("Int", GetType(Integer))


    dt.Columns.Add("Date", GetType(Date))


    dt.Rows.Add("a", 0, System.DateTime.Now)


    dt.Rows.Add("b", 1, System.DateTime.Now)


    dt.Rows.Add("c", 2, System.DateTime.Now)


    dt.AcceptChanges()


    Me.FpSpread1.DataSource = dt.DefaultView


    Me.FpSpread1.Sheets(0).Cells(0, 0).Value = "ABC"        '<---- Generates a NULL reference exception.  If I bind to the datatable instead, this works


    End Sub


    Here is the exception:


     


    System.NullReferenceException was unhandled
      Message="Object reference not set to an instance of an object."
      Source="FarPoint.Win.Spread"
      StackTrace:
           at FarPoint.Win.Spread.Model.DefaultSheetDataModel.SetValue(Int32 row, Int32 column, Object value)
           at FarPoint.Win.Spread.Cell.set_Value(Object value)
           at Example.Form1.Form1_Load(Object sender, EventArgs e)


    etc.


    Thanks,


    Bob


     


     

  • Replied 8 September 2017, 1:52 pm EST

     


    Hello Bob,


    I have escalated the reported issue as a bug to our QA team to Fix. Hope it should be fixed in next maintenance release. Bug Number: 25666


    Thanks,


    Deepak Sharma


     


     

Need extra support?

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

Learn More

Forum Channels