Have wrriten the following code to remove selected items from a listbox. However keep getting an Index out of range error and can't figure out why.
Sub remProd()
Dim productsLbx As ListBox = dvSales.FindControl("lbxProducts")
Dim count As Integer = productsLbx.Items.Count
For i As Integer = 0 To count - 1
If productsLbx.Items.Item(i).Selected Then 'Error occurs here
productsLbx.Items.RemoveAt(i)
i -= 1
count -= 1
  ...
Go to the complete details ...