[Gambas-user] Slow Gridview creation

M. Cs. mohareve at ...626...
Wed Jan 28 21:36:20 CET 2009


Dear Benoit,
I would like to know whether it is possible to make GridView creation and
filling process faster. I'm using databases for storage, then I'm doing the
querries, which are giving tens of thousand results, or tens of thousand
rows with five columns each. First, I put the results into five separated
arrays, and afterwards I'm using them with a FOR...NEXT cycle. This is the
code I'm using:

visszhang = DBconX.Exec(quert)
FOR EACH visszhang
nev.Add(visszhang!"FName")
ut.Add(visszhang!"FPath")
nagy.Add(Round(visszhang!"FSize" / 1048576, -2))
mikor.Add(visszhang!"FChanged")
kotet.Add(point)
NEXT
dis = nev.Count
gV.Rows.Count = dis
FOR i = 0 TO dis - 1
gV[i, 0].Text = nev[i]
gV[i, 1].Text = kotet[i]
gV[i, 2].Text = ut[i]
gV[i, 3].Text = nagy[i]
gV[i, 4].Text = mikor[i]
NEXT

But like this it takes eternity to create a table of 17.000 rows. There is a
remark in Gambas documentation:
* You should use the last
method<file:///usr/share/gambas2/help/help/def/method.html>if you have
thousands of rows to display.
*What does it exactly mean? Can you recommend me a faster algorithm? Thanks!



More information about the User mailing list