I need some advise/help from more experienced Xojo developers.
I understand that SelectionChanged event is triggered either by user explicitly selecting row in the WebListBox or via code such as:
AccountsListBox.SelectedRowIndex = -1
I often need to select row in the WebListBox (ex: AccountsListBox) via code but I would like to avoid triggering AccountsListBox.SelectionChanged event.
Here is an example of the code that selects relevant row in AccountsListBox:
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
AccountsListBox.SelectedRowIndex = j
Exit For
End If
Next
I thought about adding property to this WebPage to use it with a test inside AccountsListBox.SelectionChanged event but I am not sure when to set/clear this property.
What would be the best way to “do nothing” inside the AccountsListBox.SelectionChanged event when the code is changing AccountsListBox.SelectedRowIndex?
2 posts - 2 participants