Posted 8 September 2017, 3:14 pm ESTI have a project that contains several forms in a library which are used in multiple places within my applications. Many of these forms contain spreadsheets. However, even though I'm able to use the CheckBoxCellType successfully within most of them, I'm having a problem with a NullReferenceException on one of them when the SpreadView is being drawn. I cannot for the life of me figure out what is different about this form that is causing this error. I have tried changing the properties on both the SpreadSheet object and the Sheet object to match those of the forms that run without a hitch, but I still cannot seem to get past this error.
Here is a snippet of my code where I'm initializing the SpreadSheet with the CheckBoxCellType in the forms:
Dim ckbxcell As New FarPoint.Win.Spread.CellType.CheckBoxCellType()
.Columns(Cols.Selected).CellType = ckbxcell
.Columns(Cols.Selected).Label = "(6)" & Environment.NewLine & "Filter" & Environment.NewLine & "Zone"
.Columns(Cols.Selected).Width = 70
.Columns(Cols.Selected).HorizontalAlignment = CellHorizontalAlignment.Center
.Columns(Cols.VisibleTop).CellType = ckbxcell
.Columns(Cols.VisibleTop).Label = "(7)" & Environment.NewLine & "Visible" & Environment.NewLine & "Top"
.Columns(Cols.VisibleTop).Width = 40
.Columns(Cols.VisibleTop).HorizontalAlignment = CellHorizontalAlignment.Center
This is being done the same way in the form without the problem as well as the form with the problem.
Here is the details of the error I'm receiving:
Message=Object reference not set to an instance of an object.
at FarPoint.Win.Spread.SpreadView.g(Graphics A_0, Int32 A_1, Int32 A_2)