[Gambas-user] How to get started with WebView

Benoît Minisini gambas at ...1...
Wed Jan 25 15:45:24 CET 2017


Le 25/01/2017 à 15:33, Rolf-Werner Eilert a écrit :
>
> The only thing I could not make out is how to control the tableview. As
> there is no treeview and no listview, I would use tableview to replace
> both of them. No real problem, but
>
> - How can I determine the number of rows and columns
> - How can I add contents
> - How can I delete contents / rows
>
> Could you explain in a few lines?
>
> Regards
> Rolf
>

WebTableView does not store any contents. It just raises a 'Data' event 
for each cell, and you must fill the 'Data' argument of the event 
handler with the cell contents.

But before that, you have to define the number of rows and columns.

The number of rows is defined by the WebTableView.Count property.

The number of columns is defined by successive calls to the 
WebTableView.AddColumn(<title>,[<width>,<alignment>]) method, or by 
setting the WebTableVieW.Columns.Count property and the properties of 
each column.

The WebTableView displays only the first 100 rows. It loads the other 
rows when scrolling as needed.

If you want to add or delete rows, you have to redefine the Count 
property. That will trigger a refresh, and call the Data event accordingly.

The Mode property allows to switch between no selection / single 
selection / multiple selection modes.

There is no column click / sorting feature yet.

Regards,

-- 
Benoît Minisini




More information about the User mailing list