Click here to Skip to main content
15,895,256 members

Comments by Mike_Finch (Top 1 by date)

Mike_Finch 8-Jun-11 17:40pm View    
I have the deletion problem also. I have a BindingList for a data source, which I provide to the BindableListView. When I remove an item from the BindingList, the ListViewItem in the BindableListView associated with that item disappears, and so does the one for the next item.

When I call BindingList.Remove() to remove the desired item, I observe that:

* BindableListView.currencyManager_ItemChanged() is called, where the given ItemChangedEventArgs.Index is -1.

* That causes BindableListView.LoadItemsFromSource() to be called, which repopulates the ListViewItems.

* Then, BindableListView.bindingList_ListChanged() is called, where the given ListChangedEventArgs.ListChangedType is ItemDeleted. This causes another ListViewItem to be erroneously removed.

I experience this problem even when I encase my item removal in BeginUpdate...EndUpdate calls as Paul Hildebrandt suggested in his solution.

(For my own reference, this is a comment to a question titled "bindable listview seems to duplicate entries".)