[Gambas-user] TableView -Multi-Mode- Get Selected rows

Charlie Reinl na2492 at ...9...
Wed Feb 16 23:00:18 CET 2005


> 
>Hello List members 
> 
>I'm trying to set up an app to access a mysql-database. Everything went 
fine  
>so far. 
> 
>Now I ran into a problem: 
>I made a dialog in modal mode, where I want the user to select items from 

a  
>list (represented by a tableview widget). 
>It should be possible to select multiple items at once (The dialog will 
than  
>pass back an integer[] with the corresponding id's from the selected 
items) 
> 
>So I set the tableview mode to "multi". Fine: I can do mutliple 
selections. 
> 
>_But: How can I read from the tableview widget, which rows are selected?_ 

> 
>In "single" mode it's easy: I just have to read the tableview.row 
variable. 
>How do I get the needed information in "multi" mode? 
> 
>regards, 
>Thomas 
> 
Salut Thomas, 
 
for shure it is not easy to find in help. 
You have to look at .TableViewRow , there you find Selected .   
You use it like that. 
 
PUBLIC SUB Button2_Click() 
DIM ni AS Integer 
FOR ni =0 TO  tbvSelect.Rows.Count - 1 
  IF tbvSelect.Rows[ni].Selected THEN 
    PRINT ni 
  ENDIF 
NEXT 
END 
 
Amicalment 
Charlie 
* Gesendet mit / Sent by: FEN-Webmail * http://www.fen-net.de *




More information about the User mailing list