I'm trying to remove objects from a BindingList that is bound to a DataGridView by doing this...
private void RemoveItems(List<Payment> removeList)
{
for (int i = removeList.Count - 1; i >= 0; i--)
{
sortableBindingPaymentList.Remove(removeList[i]);
}
}
Trying to debug this myself i attempted the following, however remover always = -1 (meaning that no match was found) and I'm 110% sure that my list of Payment's in removeList contains a match in my sortableBindingList...
private void RemoveItems(List<Payment> removeList)
{
int remover;
for (int i = removeList.Count - 1; i >= 0; i--)
{
remover = sortableBindingPaymentList.IndexOf(removerList[i]);
sortableBindingPaymentList.RemoveAt(remover);
}
}
Any help is appreciated and thanks in advance!