Hi,
I use collections of entities with Infragistics grid. In this grid it's possible to delete rows.
Now I want to bind my collection to this grid. When a row from the grid is deleted I want to remove the entity from my collection.
I store the collection in my session. This way I can switch between pages and the collection will still be available.
At some point I want to save my changes. Which means in this case that when I click this button I want all the removed entities from my collection to be deleted from the database. (at this point).
So I can't call the Collection.Delete method when removing them from my collection, and when I do Collection.Remove() the entity is removed and I can't delete it anymore.
How can I solve this? The problem is also that the entity being removed is an entity that was just added in memory also. And in this case it doesn't have to be removed from the database at all.
The only solution that I can think of is first delete all the rows in the table and after that add all the entities from the collection again, but this is not an ideal situation.
Can someone please advice me what to do?
Gr.,
G.I.