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

    <SPAN style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt;mso-ansi-language:EN-GB;">Dear Support team<o:p></o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt;mso-ansi-language:EN-GB;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt;mso-ansi-language:EN-GB;">I’m using you FarPoint for Windows Form and I face with problem.<o:p></o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt;mso-ansi-language:EN-GB;">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 <SPAN style="mso-spacerun:yes;"> </SPAN>after I show a modal form and return to form with your grid.<o:p></o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt;mso-ansi-language:EN-GB;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt;mso-ansi-language:EN-GB;"><SPAN style="mso-spacerun:yes;"> </SPAN>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 ?<o:p></o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt;mso-ansi-language:EN-GB;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt;mso-ansi-language:EN-GB;">I do not have pic. In fields, I just have some rows text with different colour. Here you my RTF string for cells<o:p></o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Courier New';COLOR:blue;FONT-SIZE:10pt;mso-no-proof:yes;">string</SPAN><SPAN style="FONT-FAMILY:'Courier New';FONT-SIZE:10pt;mso-no-proof:yes;"> s = <SPAN style="COLOR:#a31515;">@"{\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 <Time>\cf0\b0\fs24\par\fs16 <Name>\par<Price>\par<Duration>\fs20\par}"</SPAN>;</SPAN><SPAN style="FONT-FAMILY:'Courier New';FONT-SIZE:10pt;mso-ansi-language:EN-US;mso-no-proof:yes;"><o:p></o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Courier New';FONT-SIZE:10pt;mso-ansi-language:EN-US;mso-no-proof:yes;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Courier New';FONT-SIZE:10pt;mso-no-proof:yes;">grd.Sheets[0].SetValue(iRow, iCol, s);</SPAN><SPAN style="FONT-FAMILY:'Courier New';FONT-SIZE:10pt;mso-ansi-language:EN-US;mso-no-proof:yes;"><o:p></o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Courier New';FONT-SIZE:10pt;mso-ansi-language:EN-US;mso-no-proof:yes;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Courier New';FONT-SIZE:10pt;mso-ansi-language:EN-US;mso-no-proof:yes;">I replece for every cell <Time></SPAN><SPAN style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt;mso-ansi-language:EN-US;"><o:p></o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt;mso-ansi-language:EN-GB;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt;mso-ansi-language:EN-GB;">Can I change some think in this string to get result more fast drawing of grid?<o:p></o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt;mso-ansi-language:EN-GB;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt;mso-ansi-language:EN-GB;"><SPAN style="mso-spacerun:yes;"> </SPAN>Thanks.<o:p></o:p></SPAN>

  • Replied 8 September 2017, 2:21 pm EST

    Hello,


    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

    Hello,


     


    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