Loading data in the flexgrid takes long time

  • Thread starter Thread starter schapopa
  • Start date Start date
S

schapopa

I have a flex grid and I am loading data to this flex grid in this way
While sqldr.Read
j = j + 1

MSFlexGrid1PLSummary.set_TextMatrix(MSFlexGrid1PLSummary.Row,
MSFlexGrid1PLSummary.Col, sqldr("date1") & "q-" & sqldr("date2"))

MSFlexGrid1PLSummary.Row = 1
MSFlexGrid1PLSummary.CellFontBold = True
If Not IsNothing(sqldr("Total1")) Then
MSFlexGrid1PLSummary.set_TextMatrix(MSFlexGrid1PLSummary.Row,
MSFlexGrid1PLSummary.Col, VB6.Format(sqldr("Total1"), "##,##0.00"))
End If

MSFlexGrid1PLSummary.Row = 2

If Not IsNothing(sqldr("Date2")) Then
MSFlexGrid1PLSummary.set_TextMatrix(MSFlexGrid1PLSummary.Row,
MSFlexGrid1PLSummary.Col, VB6.Format(sqldr("Date2"), "##,##0.00"))
End If

etc...
and I have about 100 rows.

With 9 records that I have filling this flexgrid takes about 4 second.
Then I have few flexgrids on tabs, so the whole form is running very
slow.
Query itself in query analyzer runs immediatelly: 0 second.
I use flexgrid because I have grouping of data and didn't find out how
can I use datagrid for the same display of data.

How can I improve performance of that form?
Thank you
Schapopa
 
Hi

suddenly I see a link in my message, I don't know how that came there.

Cor
 
Thank you for your reply. I will try to learn more about datagrids and
maybe replace existing flexgrid with that control.
Cheers
Schapopa
 
As I am looking through your webside and examples that you posted I am
wondering if it is possible to have first column of the grid to be just
a text, something like in flex grid:

MSFlexGrid1PLSummary.set_TextMatrix(1, 0, "TOTAL SALES")

and then the remaining part of the row filled with data.
Thank you
Schapopa
 
Hi, I saw your post when doing some googling on the datagrid, and just a tip
for you and future googlers to speed up the flexgrid is using the
flexgrid.redraw property, befor loading the data set flexgrid.redraw = false
then after the loading is done, set flexgrid.redraw = true.

Hth

Greetz Peter
 
Back
Top