We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GridControl slow redrawing/scrolling when using Currency cells

Hello, When I use many Currency cells in the grid control the redrawing (while resizing) and the scrolling are very slow and jerky. If there are rows/cols outside of the viewable area of the grid resizing the grid or scrolling can be quite time consuming an occasionally cause the grid to redraw incorrectly. You can use the "Syncfusion grid samples\Quick Start\VirtualGrid" to reproduce this behaviour. Reduce the number of rows back to 200: ------------------------------------ Sub GridQueryRowCount(ByVal sender As Object, ByVal e As GridRowColCountEventArgs) e.Count = 200 e.Handled = True End Sub 'GridQueryRowCount ------------------------------------ Then in sub "GridQueryCellInfo" where the cell is being set to "Static", instead change it to "Currency": ------------------------------------ If e.ColIndex = 2 Then If e.RowIndex Mod 2 = 0 Then e.Style.CellType = "PushButton" Else e.Style.CellType = "DropDownGrid" End If e.Style.Description = "Click" Else e.Style.CellType = "Currency" '/%%% CHANGED HERE End If --------------------------------------- Now run the project and resize the form, or try to scroll down to the last row. I have tried compiling, this code and it makes no difference to performance. The project I am working on relies heavily on the Currency cell type. I am not actually using a virtual grid, but I investigated it to see if the problem lied within the grid control accessing it's own internal copy of the data.- So I imagine the redrawing logic or parsing of currency data might be the issue? Many thanks for any assistance you can offer. Dorian Hill Momentech Software Services.

6 Replies

AD Administrator Syncfusion Team September 6, 2003 08:29 AM UTC

The problem is that the Currency CellType is relying on the CurrencyControl to do the formatting for static drawing. This slows things down. One solution is to derive your own currency cell type, use Static formatting to format the static drawing, and only use the CurrencyControl while the cell is being edited. If you are only doing standard formatting for the CurrencyControl, this is fairly straight forward. Attached is a sample of this.

DH Dorian Hill September 7, 2003 09:11 PM UTC

The performance is a little better, but I don't understand how the user edits the cell now. When ever I try to edit one of the "QCurrency" cells I get an exception. Do I have to detect when the focus enters the cell, then if it is a "QCurrency" change it to a standard Currency cell to allow normal editing?

AD Administrator Syncfusion Team September 8, 2003 07:31 AM UTC

You should not have to do anything as the QCurrency only changes what happens when the cell is staticcally drawn. It should be exactly like the Currency cell when the cell is actively being editied. Do you have a problem editing in the attached sample project? Or is it just when you try to use the cell type? Are you setting the CellValueType property like the sample code does?

DH Dorian Hill September 8, 2003 08:29 PM UTC

I have the problem when I edit the sample you sent me. I just select one of the cells in the second column, then change the number. When I attempt to exit the cell, some kind of validation code prevents the focus from being forwarded. See the attatched file for the exception. The cell then changes to display "exception" with a red BackColor. I'm using version and VS.net 2003 . -if that helps.

AD Administrator Syncfusion Team September 8, 2003 09:32 PM UTC

I am using a private build, and with that build I do not see this problem. With the build, I do see the problem with the sample. You can get a download link for this private build by submitting a Direct Trac support incident requesting it.

DH Dorian Hill September 8, 2003 11:32 PM UTC

I'll do that. Thanks again for your prompt and useful responses. Dorian Hill.

Live Chat Icon For mobile
Up arrow icon