I am not sure whether it's a bug or if I am doing something wrong. I am using FastDataListView which is bound to List with a flat object.
Everything works well until I am removing the only one item from my list and try to enable a column which is hidden by right mouse on the header. Then I am facing the following "A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll System.ArgumentOutOfRangeException:"
Here we get the exception --> Index is 0 but CurrencyManager.List.Count is 0 too...
if (this.CurrencyManager.List.Count >= index) return;
But nonetheless I am not sure how to work properly. When I am removing any item in my List<T> I actually call the following after removing. Is that right in that way?
RebuildColumns();
I am asking here because invalidate / refresh / update didnt show the actual list content?
Last edit: koori 2015-03-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there,
I am not sure whether it's a bug or if I am doing something wrong. I am using FastDataListView which is bound to List with a flat object.
Everything works well until I am removing the only one item from my list and try to enable a column which is hidden by right mouse on the header. Then I am facing the following "A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll System.ArgumentOutOfRangeException:"
Here we get the exception --> Index is 0 but CurrencyManager.List.Count is 0 too...
this.ListView.SelectedObject = this.CurrencyManager.List[index];
I just fixed it by following line of code.
if (this.CurrencyManager.List.Count >= index) return;
But nonetheless I am not sure how to work properly. When I am removing any item in my List<T> I actually call the following after removing. Is that right in that way?
RebuildColumns();
I am asking here because invalidate / refresh / update didnt show the actual list content?
Last edit: koori 2015-03-30
I think this bug was fixed in v2.8.1
Hi,
are u sure has been fixed in v2.8.1 ? Just because I'm using that version and I got same error.
Can you check the version? Could you also post the stack trace?
Hi Phillip,
I have same problem with version 2.8.1. This issue is fixed when i downgraded to 2.8.0.
I saw this code on v2.8.0:
// Make sure the index is sane (-1 pops up from time to time)
if (index < 0 || index >= this.ListView.GetItemCount())
return;
regards,
Hmmm, yes, that code change looks suspicious (read: blatantly wrong). I have no idea how that code vanished.
I'll put it back into v2.9