Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Problem with CExtReportGridWnd's performance Collapse All
Subject Author Date
Nguyen The Thuat Jul 24, 2012 - 9:27 PM

Hi all,

I’m working on CExtReportGridWnd class to fill records which retrieved from database. Note that we have 5,000 return records and 11 columns, and seem our grid loaded data slowly. Need 8 seconds to populate 5,000 records.

Please let me know how to improve Grid Performance. We have to provide sort and filter data functionality to my customer so I couldn’t use other grid.

Here is steps that I implemented:

1. Create Columns using CExtReportGridColumn class, adjust width of each column to best fit

2. Initiate all items depending on number of return records. Iterate each item and set text for its cells. Based on data type of each cell, I will convert to valid data and setting for cells.
+ Text data: using CExtGridCellString
+ Integer data: using CExtGridCellVariant
+ Double data: using CExtGridCellNumber
+ Date time data: using CExtGridCellDateTime
+ Boolean data: using CExtGridCellCheckBox

3. Perform adjust text and icon alignment for necessary columns

4. Sort some columns: using multiple sort for 5 columns

5. Apply layout that was saved into registry for this grid

6. Finally, update ScrollBar and redraw grid

OnSwUpdateScrollBars();
OnSwDoRedraw();

Technical Support Jul 30, 2012 - 12:13 PM

CExtGridCellVariant and CExtGridCellNumber cells are based on OLE VARIANT data types. CExtGridCellString uses dynamic heap memory allocations for storing text. These cells are not the fastest cells.
CExtReportGridWnd class manages tree like data even in plain mode. So, some additional time is required for allocating tree management data structures.
If you need to display big data arrays (millions of records) immediately, then please switch using CExtGridWnd control in cached mode. This is demonstrated in the AdoRecordsetView sample application provided with Prof-UIS. Here is editable version of it:
http://www.prof-uis.com/download/forums/AdoRecordsetEdit.zip
Here is another sample project demonstrating cached grid:
http://www.prof-uis.com/download/forums/CacheableGrid2.zip