NullReferenceException on GrapeCity.Spreadsheet.Worksheet.set_ColumnCount(1)

Posted by: ibissoftware on 7 February 2019, 11:06 pm EST

    • Post Options:
    • Link

    Posted 7 February 2019, 11:06 pm EST

    Hi There,

    We are getting an error on with version 11.45.20183.0 of Farpoint, In version 9 this error does not occur.

    This error seem to occur when a large number (approx. 100) of NamedStyles are added to and removed from the collection. Not all NamedStyles have a unique name.

    The callstack is as follows:

    at GrapeCity.Spreadsheet.GradientFillEffect.GetHashCode()

    at System.Collections.Generic.GenericEqualityComparer

    1.GetHashCode(T obj)    at System.Collections.Generic.Dictionary
    2.Remove(TKey key)

    at GrapeCity.Spreadsheet.GenericStorage`1.Remove(Int32 id, Int32 refCount)

    at GrapeCity.Spreadsheet.FillStorage.Remove(Int32 id, Int32 refCount)

    at GrapeCity.Spreadsheet.StyleDataStorage.DecreaseMemberReferenceCount(StyleData& styleData)

    at GrapeCity.Spreadsheet.StyleDataStorage.Remove(Int32 id, Int32 refCount)

    at GrapeCity.Spreadsheet.Win.SpreadWorkbook.RemoveStyle(Int32 styleDataId)

    at GrapeCity.Spreadsheet.Win.SpreadWorksheet.ClearDefaultNamedStyles(Boolean ignoredChangeStorage)

    at ov.ai()

    at GrapeCity.Spreadsheet.Win.SheetCompositor.Composite(Worksheet worksheet, Int32 row, Int32 column, StyleData& currentStyle)

    at GrapeCity.Spreadsheet.Win.SpreadWorksheet.GetCompositeStyleData(Int32 row, Int32 column, Int32 alterIndex, Boolean ignoreSheetLevel, Boolean getExtendDataOnly)

    at GrapeCity.Spreadsheet.Win.SpreadWorksheet.GetCompositeStyleFormatFromModelOnly(Int32 row, Int32 column, Int32 alterIndex, Boolean getExtendDataOnly, Boolean ignoreSheetLevel)

    at qd.a(Int32 A_0, Int32 A_1, Int32 A_2, Boolean A_3, Boolean A_4)

    at FarPoint.Win.Spread.SheetView.i(Int32 A_0, Int32 A_1, Boolean A_2)

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

    at FarPoint.Win.Spread.SpreadView.a(Object A_0, SheetViewPropertyChangeEventArgs A_1)

    at FarPoint.Win.Spread.SheetViewPropertyChangeEventHandler.Invoke(Object sender, SheetViewPropertyChangeEventArgs e)

    at FarPoint.Win.Spread.SheetView.FirePropertyChanged(String propertyName)

    at FarPoint.Win.Spread.SheetView.a(Int32 A_0, Int32 A_1, Boolean A_2, Boolean A_3, Boolean& A_4)

    at FarPoint.Win.Spread.SheetView.OnAddColumns(Int32 column, Int32 count)

    at FarPoint.Win.Spread.SheetView.OnDataModelChanged(Object sender, SheetDataModelEventArgs e)

    at FarPoint.Win.Spread.Model.SheetDataModelEventHandler.Invoke(Object sender, SheetDataModelEventArgs e)

    at FarPoint.Win.Spread.Model.BaseSheetDataModel.OnChanged(SheetDataModelEventArgs e)

    at FarPoint.Win.Spread.Model.DefaultSheetDataModel.OnChanged(SheetDataModelEventArgs e)

    at FarPoint.Win.Spread.Model.DefaultSheetDataModel.FireChanged(Int32 row, Int32 column, Int32 rowCount, Int32 columnCount, SheetDataModelEventType type)

    at FarPoint.Win.Spread.SheetView.ah(Int32 A_0, Int32 A_1)

    at GrapeCity.Spreadsheet.ActionData.ExecuteFinalize()

    at GrapeCity.Spreadsheet.Worksheet.InsertColumns(Int32 column, Int32 count)

    at GrapeCity.Spreadsheet.Worksheet.set_ColumnCount(Int32 value)

  • Posted 10 February 2019, 10:33 pm EST

    Hello,

    You must be facing this problem because of non-unique namedstyles in Spread because there is change in DefaultSheetDataModel in Spread from V11 onwards as given in readme link below that “Two NamedStyles with same name are not allowed in NamedStyleCollection in V11”.

    https://help.grapecity.com/spread/SpreadNET12ReadMe/webframe.html#StyleModel.html

    Hence, please make sure you have unique NamedStyles in added in collection.

    Hope it helps. Else please share your small working sample replicating the issue so that we can investigate this issue further.

    Thanks,

    Reeva

  • Posted 8 May 2019, 7:27 pm EST

    Thanks for your response. We use unique style names in our software program. We will discuss internally when we are going to make a sample to tackle this problem. We can then send this sample to you as an example.

    Kind regards, Joost

  • Posted 9 May 2019, 4:11 pm EST

    Hello,

    We will wait for your sample then. Please take your time.

    Thanks,

    Reeva

Need extra support?

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

Learn More

Forum Channels