ReadOnlyBindingListBase AllowRemove

ReadOnlyBindingListBase AllowRemove

Old forum URL:

AbbasMalik posted on Thursday, May 29, 2014

I have set AllowRemove = true but it still does not allow to remove item from the ReadOnlyBindingListBase

Is it possible?

JonnyBee replied on Thursday, May 29, 2014

ReadOnlyBindingListBase is - as the name implies - a readonly list class that does not support editing/removal and does no tracking.  

You _can_ set IsReadOnly = false on the list (as you must do in data access to add items to the list) but if you wish to track removals then you must choose another base class. 

Why do you need to remove items from the list? 

AbbasMalik replied on Thursday, May 29, 2014

Thanks Jonny, it works.

For simple maintenance forms, I use editable root collection and it works fine.

For complex forms with large data, I am using readonlylist for navigation purposes. It is simple list and its retrieval is quick.

And for editing I use editable root object (which is complex with 2-3 child collections). I just need to synchronize the readonly list with the edited root object just to display to the user.

Copyright (c) Marimer LLC