Probably a bug in FilteredBindingList

Probably a bug in FilteredBindingList

Old forum URL: forums.lhotka.net/forums/t/6503.aspx


stephen.fung posted on Tuesday, February 24, 2009

This is a bug report for CSLA version 3.0.2 -- I haven't verified if this is still there in the newest version, so my apologies if this has already been fixed.

There may be a bug in FilteredBindingList's implementation of ICancelAddNew.

When it's passing on the itemIndex parameter to the base list, it should first convert it from the filteredIndex to the originalIndex.

e.g.
        can.CancelNew(itemIndex);
should be:
        can.CancelNew(this.OriginalIndex(itemIndex));

I believe there should be two changes like this in CancelNew and one in EndNew.  SortedBindingList has a similar bug.

I came across this problem when binding a (MS) DataGridView to a FilteredBindingList, and found that when I clicked on the New-Row and then clicked to another row, the New-Row wasn't properly removed (a blank line was left behind).  Making the change suggested above solved my problem.

RockfordLhotka replied on Wednesday, February 25, 2009

Thanks, I'll add this to the list.

Copyright (c) Marimer LLC