[Gambas-user] Array data to Gridview?
Rolf-Werner Eilert
rwe-sse at ...3629...
Tue Feb 7 08:41:15 CET 2017
Hi Riccardo,
just use the DATA event for the Gridview.
In short: You just define the number of Columns and Rows for the
Gridview. As soon as you define the Rows, the Gridview will begin to
load the contents for the cells by jumping into the Data event over and
over again.
You only have to make sure that for every Row there are data somewhere
in the program or make sure that if there are no data yet, there is some
code in the Data event which controls that. All other code for
displaying the contents in the cells is in the Data event.
The Data event will also be jumped in when the user scrolls the table.
The Gridview will only load the part of the Gridview which is visible.
Or when the user clicks on the form or makes it come to the front. That
means, besides from providing the cell data you don't have to care about
anything, and it is extremely fast.
Regards
Rolf
Am 06.02.2017 22:24, schrieb Riccardo:
> 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.
>>
>>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
More information about the User
mailing list