[Gambas-user] Need help on dataview

Gianluigi bagonergi at gmail.com
Fri Mar 11 10:54:03 CET 2022


Il giorno ven 11 mar 2022 alle ore 10:24 Fabien Bodard <gambas.fr at gmail.com>
ha scritto:

> Hi,
>
>
> I want to maintain the position of  the selected line after an update
> of the datasource ... How can I do that ?
>
> I take any good idea :-)
>
> There is no data count change just dataline info change ... but when I
> call datasource.update , the dataview loose the position ... and the
> index ...
>
> --
> Fabien Bodard
>

Hi Fabien,

I don't know if this is correct or it's just stupid, maybe you could take
note of the current key before the changes and afterwards reposition the
focus there (DataBrowser1.View.Rows[xxx].Selected = True):
In Public Sub DataBrowser1_MouseDown()
Try iCurrentKey = CInt(DataSource1.Current[0])
If Error Then
  iCurrentKey = $iCurrentKey
Endif
...

Regards
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220311/e4f60781/attachment.htm>


More information about the User mailing list