[Gambas-user] Array data to Gridview?
Tobias Boege
taboege at ...626...
Tue Feb 7 00:33:05 CET 2017
On Mon, 06 Feb 2017, Riccardo wrote:
> Hi,
>
>
>
>
>
>
> > I have a multidimensional array with 32,000 records. It takes quite a while to load this into a Gridview, and even longer if I provide the user with some feedback during the process (an updating label, a progress bar and so on...).
>
>
>
> > Is there a faster way to load the array data into the Gridview? Currently, I'm iterating over the array and updating the Gridview cell by cell. Should I hide the Gridview during this process?
> >
> > For i = 1 To arr_Response.Length - 1
> > For j = 0 To arr_Response[i].Length - 1
> > grd_Response[i - 1, j].Text = arr_Response[i][j]
> > Next
> > Next
> >
> > cheers.
> >
Look into the Data event of GridView. According to the documentation [1]:
You can fill the grid explicitly, or implement the Data event to display
the grid contents on demand.
You should use the last method if you have a lot of rows to display.
The control can handle millions of lines gracefully.
Regards,
Tobi
[1] http://gambaswiki.org/wiki/comp/gb.qt4/gridview
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
More information about the User
mailing list