Hi
I have a form with 2 MSHFlexGrids whose contents are synchronised so same row data appears on both.
Further functionality allows the grid contents to be filtered where one cell value matches a value keyed by the user.
I perform the filter by looping through all the rows and if they do not match the value then set rowheight to 0.
My client has reported the screen refresh following a filter takes a long time.
In essence my code works as follows:
I have done some testing on a copy of the same data as my client's (4,840 rows of data)
The time to process between Comment1 and Comment2 is the same (1 second) on my local workstation as it is on my client's server.
The time to process between Comment2 and Comment3 (i.e. the issuing of the .redraw = true methods) is 2 seconds on my local workstation but 110 seconds on my client's server.
I am trying to understand why the redraw method may take so much longer on my client's server, plus how I could optimise it.
Does anyone have any suggestions?
I have a form with 2 MSHFlexGrids whose contents are synchronised so same row data appears on both.
Further functionality allows the grid contents to be filtered where one cell value matches a value keyed by the user.
I perform the filter by looping through all the rows and if they do not match the value then set rowheight to 0.
My client has reported the screen refresh following a filter takes a long time.
In essence my code works as follows:
Code:
'Comment1
flxGrid2.Redraw = False
flxGrid1.Redraw = False
strFilter = "Value to Filter"
With flxGrid2
For lngCnt = 1 To .Rows - 1
If .TextMatrix(lngCnt, 2) = strFilter Then
.RowHeight(lngCnt) = 0
Else
.RowHeight(lngCnt) = 1
End If
DoEvents
Next
For lngCnt = 1 To .Rows - 1
flxGrid1.RowHeight(lngCnt) = .RowHeight(lngCnt)
DoEvents
Next
End With
'Comment2
flxGrid2.Redraw = True
flxGrid1.Redraw = True
'Comment3
I have done some testing on a copy of the same data as my client's (4,840 rows of data)
The time to process between Comment1 and Comment2 is the same (1 second) on my local workstation as it is on my client's server.
The time to process between Comment2 and Comment3 (i.e. the issuing of the .redraw = true methods) is 2 seconds on my local workstation but 110 seconds on my client's server.
I am trying to understand why the redraw method may take so much longer on my client's server, plus how I could optimise it.
Does anyone have any suggestions?