set column level cell type using only model (no sheetview)

Posted by: fsabau on 8 September 2017, 1:59 pm EST

  • Posted 8 September 2017, 1:59 pm EST

    Hello,

    As far as I know there are 2 ways to setup cell types either at the column level (SheetView.Columns[x].CellType) or the cell level using the StyleModel. Is it possible to setup column level cell type using only the model? I'm asking this because of a performance issue I have when using cell level cell types. I was trying to split the editors from the rendererers/formatters, so that I only have 1 editor per column, but multiple renderers/formatters (for each cell in the column). In the code I have a controller which deals with setting up the model before handing it over to the spread and I don't have access to the sheet view. So, is it possible or should I modify my design so that the controller "knows" about the sheetview?

    Thanks for your help,

    Florin Sabau. 

  • Replied 8 September 2017, 1:59 pm EST

    Hello Florin Sabau,

    Using StyleModel you should be able to set the cellType at Column level, you may use

            Dim si As New FarPoint.Win.Spread.StyleInfo
            si.CellType = New FarPoint.Win.Spread.CellType.NumberCellType
            FpSpread1.Sheets(0).Models.Style.SetDirectInfo(-1, 1, si)  'to set the cell type for an entire 1st column.

    Hope it helps.

    Thanks,

     

  • Replied 8 September 2017, 1:59 pm EST

    Thank you very much, it worked!
Need extra support?

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

Learn More

Forum Channels