[Gambas-user] DataView Help

Benoit Minisini benoit.minisini at gambas-basic.org
Wed Jul 12 21:14:59 CEST 2023


Le 12/07/2023 à 01:14, T Lee Davidson a écrit :
> On 7/11/23 08:40, Gianluigi wrote:
>> I still couldn't select the correct row though, I always end up 
>> selecting the last one
> 
> It appears that DataView.Find assumes the sort order of the view is by 
> `students_id`. But, it isn't always. In fact, when the application 
> launches, the view is sorted by `surname` descending.

The Find() method takes the current sort order defined in the DataSource 
by the DataView control.

In last commit 
https://gitlab.com/gambas/gambas/-/commit/13e65fa01dcf315357bf1d2f3577f0fa9d06b3ea, 
I fixed the DataSource Find() and FindNext() methods, and propagate them 
to DataView and DataBrowser.

As LastInsertId may not be reliable, one have to use the DataView.Find() 
method to find the index of the last inserted record, knowing the 
primary keys of that record.

Now, following what I just said, I will try to add a method that finds 
the index of the last inserted record automagically.

Regards,

-- 
Benoît Minisini.



More information about the User mailing list