[Gambas-devel] gb3 GridView.Select

Benoît Minisini gambas at ...1...
Sat Dec 12 13:09:24 CET 2009


> 2009/12/12 Benoît Minisini <gambas at ...1...>:
> >> The first time a GridView.Rows.Select(a,b) is issued in code, the
> >> GridView_Select event doesn't fire at all, then after issuing
> >> subsequent selects, it works but exhibits odd behaviour; the text from
> >> the previous select is returned.
> >>
> >> Clicking on a row in the GridView always fires the _Select event and
> >> always returns the correct data.
> >>
> >> Code attached.
> >>
> >> Am I missing something here?
> >
> > If I remember, there is something weird in Qt that makes the Select event
> > being raised before the current row actually changes.
> 
> That is actually what it looks like when I observe the UI, but I
> figured if I said that people would think I was a nut.
> 
> > But you can use the Click event instead of the Select event.
> 
> No I cannot. The click event does not fire when .Rows.Select() is
> issued from within the code.
> 
> > Think that "Select" means the selection has changed, and "Click" means
> > the current row has changed, and that the two are disconnected in Qt,
> > even if the GridView is in single row selection mode.
> 
> Going by the behaviour of the sample app I included, click means
> exactly that, nothing more, nothing less; the user has clicked.
> 
> > Note that apparently that didn't change in Qt 4.
> 
> Public Sub GridView1_Click()
> 
>   Stop
> 
> End
> 
> Add that to the sample app I included and click the button until the
> cows come home. When .Rows.Select() is issued from within the code,
> the click event does not fire.
> 

Try to explicitely set the Row property instead of using Select(). The 
Select() method is actually only useful in multiple selection mode.

Regards,


-- 
Benoît Minisini




More information about the Devel mailing list