Yes, that's the Problem.
In non-virtualmode, the Report is fast as i want, but i need ca. 10 seconds to fill many data and i need much core.
The scrolling und moving is than fast.
In virtualmode, the first userresponse is very fast (i save time for loading the grid), but the scrolling and moving is heavy.
This is the init at form_load:
With repReport ' the grid With .PaintManager .ColumnStyle = xtpColumnFlat .NoItemsText = "" .HideSelection = False .HotTracking = False .InvertColumnOnClick = False .VerticalGridStyle = xtpGridSolid .HorizontalGridStyle = xtpGridSolid .TextFont.Name = FontName .TextFont.Size = FontSize .CaptionFont.Name = FontName .CaptionFont.Size = FontSize .ShadeSortColumn = False With .HeaderHeightFormula .Constant = 0 End With .SelectedRowBackColor = .HighlightBackColor .SelectedRowForeColor = .HighlightForeColor .FreezeColsDividerStyle = xtpReportFreezeColsDividerThin .FreezeColsDividerColor = vbBlack End With .ToolTipContext.Style = xtpToolTipBalloon .AllowEdit = False .HeaderRowsAllowEdit = False .ShowHeaderRows = True .FocusSubItems = True .MultipleSelection = False Set .Icons = gMain.cmdBars.Icons ' shared Icons .AutoColumnSizing = False .AllowColumnResize = True .SetCustomDraw xtpCustomBeforeDrawRow Or xtpCustomMeasureRow .PaintManager.FixedRowHeight = False End With
If i later get the recordset from the database i do the following
.SortOrder.DeleteAll ' no Sort
.Columns.DeleteAll ' no columns .SetVirtualMode Recordset.RecordCount
and build all columns from the recordset.fields-collection.
finally i call "populate".
I use a fixed rowheight of 17.
The screen contains only 17 rows, my recordset contains 27 records.
The MeasureRow is called twice for each row and for this 17 rows, the report needs 0.8 seconds from 1 row to the next row !
following events occur:
5 events BeforeDrawRow, row 1 columns 1 to 5
1 event MeasureRow, row 1
5 events BeforeDrawRow, row 1 columns 1 to 5
1 event MeasureRow, row 1
5 events BeforeDrawRow, row 1 columns 1 to 5
this are 17 events, even if it where enough with 6 events.
so, for 17 rows i get 289 events !
Each cursormovement or itemclick will redraw the whole visible grid.
May be, that this is the same at non-virtualmode, but this can not be the reason for this performance.
In the demo-virtual-list-project its work very fast !
How can i analyse the problem ?
Any ideas ?
|