WebListBox.RemoveRowAt() giving KeyNotFoundException

I have a Method to filter a ListBox by removing Rows that don’t contain certain text. It works fine for Desktop. It also works fine for Web in a Test app. But the same Method is giving a KeyNotFoundException in my Web App when it goes to .RemoveRowAt(XXX) where XXX is an existing Row (ie not out of bounds).

In my case it is wanting to remove Row #2 and there are 8 Rows in the WebListBox.

I created a test WebApp and the same Method has no KeyNotFoundException. Any clues on why this might be happening?

It turns out that RowCount is not being updated properly for a WebListBox when you add, remove, re-add Rows, then try to remove them again.


1 Like