Spread.NET
In This Topic
    DataModel
    In This Topic

    Following are the breaking changes for DataModel.

    ColumnHeader/ RowHeader/ ColumnFooter Data Model

    In Spread WinForms v12, these models have been replaced with new internal models to gain more support from new calculation engine of SpreadCommon.

    In order to reuse the old logic assign DefaultSheetDataModel to header models. For example:

    sheetView.Models.ColumnHeaderData = new DefaultSheetDataModel(1,sheetView.ColumnCount);
    sheetView.Models.ColumnFooterData = new AggregationDataModel(sheetView.Models.Data);
    sheetView.Models.RowHeaderData = new DefaultSheetDataModel(sheetView.RowCount,1);
    

    The new models are designed to support most common use cases from user. Hence, some API's which are not considered common will not have any effect. For example,

    //won't have effect
    fpSpread1.ActiveSheet.Models.ColumnHeaderData.NonEmptyRowCount
    fpSpread1.ActiveSheet.Models.ColumnHeaderData.NonEmptyColumnCount
    
    //have effect
    fpSpread1.ActiveSheet.Models.ColumnHeaderDaata.ColumnCount = 600;
    fpSpread1.ActiveSheet.ColumnHeader.RowCount = 3;
    fpSpread1.ActiveSheet.ColumnHeader.Cells[0,0].Value = 10;
    fpSpread1.ActiveSheet.CoulmnHeader.Cells[1,1].Text = 11;
    fpSpread1.ActiveSheet.ColumnHeader.Cells[2,2].BackColor = Color.Red;
    fpSpread1.ActiveSheet.ColumnHeader.Cells[2,2].Row.Height = 40;
    

    In Spread WinForms 12, when custom model for ColumnFooterDataModel is not set (default mode), only public API ColumnFooter.SetAggregationType is supported. This means that a formula will be set to data model of ColumnFooter to reflect the desired effect. However, set aggregation format, get aggregation format/type will have no effect.

    Back to ColumnHeader/RowHeader/ColumnFooter.