more problems with inherited it kills ColumnFooter Aggregation

Posted by: kbj on 26 January 2020, 10:55 am EST

  • Posted 26 January 2020, 10:55 am EST

    Using a custom data model kills ColumnFooter Aggregation.

    Imports FarPoint.Win.Spread.Model

    Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
    Dim dm = New classWsDataModel
    dm.RowCount = 1
    dm.ColumnCount = 1
    FpSpread1.Sheets(0).Models.Data = dm
    FpSpread1.Sheets(0).ColumnFooterVisible = True
    FpSpread1.Sheets(0).ColumnFooter.SetAggregationType(0, 0, FarPoint.Win.Spread.Model.AggregationType.Sum)
    End Sub
    End Class
    Public Class classWsDataModel
    Inherits DefaultSheetDataModel
    End Class
  • Replied 28 January 2020, 2:01 am EST


    I am able to reproduce the issue at my end. I have escalated the issue to our development team (SPNET-2466)and will inform you once I get any information from them.

  • Replied 1 February 2020, 2:52 am EST

    Just so we don't get into an infinite loop. I need to have an class inherited from the DefaultSheetDataModel for my project. it is the only way I can conceive to pass a cell's row and column information to the celltype for formatting and painting. I also use the custom data model for some storage and updating routines.
    If you could, please check on the progress of "SPNET-2466". It would be more efficient if developers could check on the progress of problems.
  • Replied 4 February 2020, 11:23 pm EST


    Sorry, it is not possible to check the progress for the customers. As it is the internal tool. You can ask here for any progress.

    I am discussing with the development team and found that it is by design. All new features from Calculation Engine won't be available in custom data model. They can be used with internal default data model only.

    For painting with row/column indexes, I have opened an enhancement request(SPNET-2782) which provide rowIndex and columnIndex in PaintCell function.

    For storing extra data, I think it's better that customer use DefaultSheetDataModel.SetTag instead of using custom data model.


  • Replied 5 February 2020, 6:07 am EST

    Since cellTypes are not specific to any spread or worksheet, it would be important to identify the calling sheet (not spread) as well as the row and column indexes. I can't believe this would be particularly complex.
  • Replied 5 February 2020, 4:40 pm EST


    Yes, they are discussing about the new API which contains the sheet/column/row info.

  • Replied 6 February 2020, 3:40 am EST

    That is good news!
  • Replied 24 April 2020, 2:02 am EST


    I am glad to tell you that your issue has fixed now. Please download the latest version:
    Sample code:

    fpSpread1.ActiveSheet.Cells["A2"].CellType = new abc();

    private class abc : GeneralCellType, IEnhancedRenderer
    void IEnhancedRenderer.PaintCell(Graphics g, Rectangle r, FarPoint.Win.Spread.Appearance appearance, object value, bool isSelected, bool isLocked, float zoomFactor, ExtraRendererSettings extraRendererSettings)
    g.DrawString(extraRendererSettings.Row.ToString() + " - " + extraRendererSettings.Column.ToString(), appearance.Font, Brushes.Red, r.Location);

    Hope it helps.

  • Replied 1 January 2021, 8:16 am EST

    Hi Mohit,
    I just checked out the IEnhancedRenderer interface and while the extraRendererSettings contains both row and column indexes (which is great!) I don't see where I can figure out what sheet that is calling the PaintCell. Am I missing something? I know I could create a celltype for each sheet and store a reference to that sheet in the property of the celltype. But I'd like to have a single celltype object that is used by many different workbooks and sheets. This simplifies user on the fly customization of numeric formats. Let's say the user wants to display Dollar figures without cents, changing 1 celltype used by all the different spreadsheets in an app streamlines that change without having to know what sheets are open.
  • Replied 6 January 2021, 10:16 pm EST

    Hi Kingman,

    We have informed the developers about this. The Sheet information will be added in Spread v14 SP1.

  • Replied 2 February 2021, 6:41 am EST

    Thanks Jitender,
    I cannot overemphasize you how helpful this will be. BTW your example worked great.
Need extra support?

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

Learn More

Forum Channels