[Gambas-user] DataView Help
gradobag at gradobag.it
Wed Jul 12 09:04:07 CEST 2023
Il 12/07/23 01:14, T Lee Davidson ha scritto:
> 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 last inserted record is last in the database table. So,
> DataView.Find sets the current row to the last record in the view even
> if it is not sorted by `students_id`.
> It appears to me to be a bug. But, I don't know how DataView.Find
> could determine the sort order of whichever column.
Yes, and so does DataSource.Find which, the wiki states, "Fin the first
row matching the specified filter and return its index."
Benoit is there any chance of getting the position, if I try to enter in
Find a second parameter that I get correctly from BeforeSave
("students_id=&1 AND surname=&2, i, $sLastSurname"), I get an error of
Query failed: near "&": syntax error.
Does the query only work on the key?
More information about the User