Menu

DataSourceAdapter - ChangePosition

koori
2015-03-30
2015-10-31
  • koori

    koori - 2015-03-30

    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
  • Phillip Piper

    Phillip Piper - 2015-05-11

    I think this bug was fixed in v2.8.1

     
    • Sergio

      Sergio - 2015-10-21

      Hi,

      are u sure has been fixed in v2.8.1 ? Just because I'm using that version and I got same error.

       
  • Phillip Piper

    Phillip Piper - 2015-10-26

    Can you check the version? Could you also post the stack trace?

     
  • Tuan

    Tuan - 2015-10-29

    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,

     
  • Phillip Piper

    Phillip Piper - 2015-10-31

    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

     

Log in to post a comment.