How to make fast repaint of grid with 1000 cells of type RichTextCellType ?

Posted by: damianrm-fp on 8 September 2017, 2:21 pm EST

  • Posted 8 September 2017, 2:21 pm EST

    Dear Support team


    I’m using you FarPoint for Windows Form and I face with problem.

    I’m using RichTextCellType and I notice very slow work. I have grid with about 1000 cells and it take 2-3 sec. ro repaint a grid. My computer is powerful, core2duo 2.6 FSB 1333, 2 GB Ram, XP SP3 , what will be in less powerful computer … Also, it have slow repaint  after I show a modal form and return to form with your grid.


     Now I use 4.0.2012.2005 , do you have improve of speed for this type fields in next release (2015)? What about ver. 5 ?


    I do not have pic. In fields, I just have some rows text with different colour. Here you my RTF string for cells

    string s = @"{\rtf1\ansi\ansicpg1251\deff0\deflang1026{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}} {\colortbl ;\red128\green0\blue0;} \viewkind4\uc1\pard\qc\cf1\lang1033\b\f0\fs16 ;


    grd.Sheets[0].SetValue(iRow, iCol, s);


    I replece for every cell


    Can I change some think in this string to get result more fast drawing of grid?



  • Replied 8 September 2017, 2:21 pm EST


    The behavior is same with latest version of Spread 4.0.2015.2005 and with version 5.0 as well, since in the WindowsForms alot of the painting(when scrolling, etc.) depends on how you set up the spreadsheet. If you are applying styles, celltypes etc. then try to do it on column and row levels and not individual cells.

    There are some performance measures steps you can do to make the Spread peform faster. First, if you are not using StickyNotes, I would suggest turning off AutoUpdateNotes property. If you are not having a provising to undo/redo capabilities, you can turn off the AllowUndo property. If you are not using formulas, you can turn off the AutoCalculation property. If you are not using cell notes, you can turn off AllowNoteEdit property. If you donot want to allow data to overflow into adjacent empty cells then you can try setting AllowCellOverflow to false. And one of the last things, you can turn off the painting by calling the SuspendLayout method before setting the cell type and SetValue method and then call ResumeLayout method to resume the painting after the SetValue method. These types of changes can significantly improve performance.

    However, with this many cells being displayed at one time, the delay would be expected when running in debug through the IDE. If you build the project in release and run the executable, then you should see the Spread's cell being more responsive.

    Hope this will help you. Thanks.

  • Replied 8 September 2017, 2:21 pm EST



    Yes, I do not use these futures and will turn it off.

    And yes .. will make test not in IDE mode. About SusoendLayout .. i know for this and was use it in your COM components, but later on NET I do not see it and decide that you was remove it ...

    In general, I understand what I need. Thanks.


Need extra support?

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

Learn More

Forum Channels