[Gambas-user] GridView not refreshing

M. Cs. mohareve at ...626...
Thu Feb 5 00:00:40 CET 2009


Dear Benoit,
having solved my previous problem with the GridView, now I'm facing a new
one:
I'm using a GridView table with 5 columns and tens of thousand rows. I'm
working on a sorting problem. I want the GridView to sort its content for
example by name.
All the names are stored in an array, and paralelly the other 4 data in
other arrays. I've created a sixth array with elements *name*index. *After
this creation I'm sorting this Array with the .Sort() method. Everyting
works fine, but having created the array of proper indices, when I invoke
the GridView.Data(x,y) method simply nothing happens. Why?

Part of the code:
....
CASE 0

FOR i = 0 TO gV.Rows.Count - 1     'Take the elements of first column and
add a * and an index
indexer.Add(gV[i, 0].Text & "*" & i)
NEXT

indexer.Sort(1) 'Sort the array ascending

FOR i = 0 TO gV.Rows.Count - 1 *'Detach the index numbers from the sorted
array and use index for the fill by splitting it*
dubl = Split(indexer[i], "*")
m = Val(dubl[1]) 'The index  of the element from the arrays which should
stay in the i-th row
gv_Data(m, 0)
gv_Data(m, 1)
gv_Data(m, 2)
gv_Data(m, 3)
gv_Data(m, 4)
NEXT

indexer.Clear()
.....

And the responding gV_Data:

PUBLIC SUB gv_Data(x AS Integer, y AS Integer)
SELECT CASE y
CASE 0
 gV.Data.Text = nev[x]
CASE 1
 gV.Data.Text = kotet[x]
CASE 2
 gV.Data.Text = ut[x]
CASE 3
 gV.Data.Text = nagy[x]
CASE 4
 gV.Data.Text = mikor[x]
 END SELECT
END

All of these arrays are global arrays, available from all parts. I don't see
the logical error, yet still nothing is happening. Why?
Thanks!



More information about the User mailing list