CanDelete?

CanDelete?

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


ajj3085 posted on Friday, August 14, 2009

Hi,

I'm coding some lists again, and I'm coming across this issue again. Sometimes, items in the list cannot be deleted, for whatever reason. So I'm trying to work out a good way for the UI to determine this.

In this case, an instance that is saved into the database can't be removed, but if a user addes a new row they should be able to delete it.

So whats would be the "proper" way to handle this? Add a CanDelete property to the instance? Add a CanDelete method to the list? (The list already overrides RemoveItem to prevent removing instances).

Should there be some standard way to ask if an item can be deleted?

JonnyBee replied on Friday, August 14, 2009

Hi,

I will point to my answer to another similar question:
http://forums.lhotka.net/forums/permalink/35485/35490/ShowThread.aspx#35490

I prefer to use the methods that Rocky has already provided in Csla and add my own custom checks in overrides.

/jonnybee

Copyright (c) Marimer LLC