Xojo2024R3.1: WebListBox.ScrollTo - does it work when using DataSource?

I have following code:

selectAccountInCode = True 
AccountsListBox.SelectedRowIndex = -1
For j As Integer = 0 To AccountsListBox.RowCount - 1
  Var vAccountId As New NumberField(True,0)
  vAccountId.Set ReadAccountID(j)
  
  If vAccountId = mCurrentAccountRow.account_id.getDouble Then
    selectAccountInCode = True 
    AccountsListBox.SelectedRowIndex = j
    AccountsListBox.ScrollTo(j) 
    Exit For
  End If
Next
selectAccountInCode = False

It is supposed to find row in the list, select row and scroll the list to show selected row.
The AccountsListBox is using DataSource, there may be large data sets involved like several thousand rows.

I don’t see the list scrolled automatically even though the row is selected (which I can see when resorting and/or scrolling “by hand”).

Is there something wrong with the code?
or
Is it because ScrollTo doesn’t work with WebListBox using DataSource?

Hi @Grzegorz_Greg_Pasternak, I think you’ve found a bug (and you already reported it #77965).

I can see the WebListBox doing some scrolling, but it doesn’t seems to be accurate, like when you are not using a DataSource.

Thanks for reporting it.

3 Likes