Collection Editor Dialog



I'm using a standard collection editor an have noticed when I click on the
Remove button the item is removed from the list but the OnRemove and
OnRemoveComplete methods are never raised.

In the followning scenario assumes my collection derives from CollectionBase
and IBindingList and assumes my collection contains three items.

1) Click the Remove button on the collection editor no event occures.
2) Click on the OK button and the following occures.
2a) A reset event occurs which clears the list.
2b) Two consecutive ItemAdded events occur.
3) Now my List only has two Items in it.

Issue I need to do some processing on the object I'm removing in the OnRemove
method before it is no longer accessible. I never get to the OnRemove
method and the OnListChanged method never receives a ListChangedEventArgs of
type ItemDelete.

How do I detect when an item is being removed from my collection by the
Collection Editor dialog? The OnInsert, OnInsertComplete, OnClear and
OnClearComplete overrides all work as expected but the OnRemove overrides do
not seem to work at all.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question