Interface IEditableCollectionView
IEditableCollectionView is an interface that a collection view can implement to enable editing-related functionality.
public interface IEditableCollectionView
Properties
- CanCancelEdit
Returns true if the view supports the notion of "pending changes" on the current edit item. This may vary, depending on the view and the particular item. For example, a view might return true if the current edit item implements IEditableObject, or if the view has special knowledge about the item that it can use to support rollback of pending changes.
- CanRemove
Return true if the view supports Remove(object) and RemoveAt(int).
- CurrentAddItem
When an AddNew() transaction is in progress, this property returns the new item. Otherwise it returns null.
- CurrentEditItem
When an EditItem(object) transaction is in progress, this property returns the affected item. Otherwise it returns null.
- IsAddingNew
Returns true if an AddNew() transaction is in progress.
- IsEditingItem
Returns true if an EditItem(object) transaction is in progress.
- NewItemPlaceholderPosition
Indicates whether to include a placeholder for a new item, and if so, where to put it.
Methods
- AddNew()
Add a new item to the underlying collection. Returns the new item. After calling AddNew and changing the new item as desired, either CommitNew() or CancelNew() should be called to complete the transaction.
- CancelEdit()
Complete the transaction started by EditItem(object). The pending changes (if any) to the item are discarded.
- CancelNew()
Complete the transaction started by AddNew(). The new item is removed from the collection.
- CommitEdit()
Complete the transaction started by EditItem(object). The pending changes (if any) to the item are committed.
- CommitNew()
Complete the transaction started by AddNew(). The new item remains in the collection, and the view's sort, filter, and grouping specifications (if any) are applied to the new item.
- EditItem(object)
Begins an editing transaction on the given item. The transaction is completed by calling either CommitEdit() or CancelEdit(). Any changes made to the item during the transaction are considered "pending", provided that the view supports the notion of "pending changes" for the given item.
- Remove(object)
Remove the given item from the underlying collection.
- RemoveAt(int)
Remove the item at the given index from the underlying collection. The index is interpreted with respect to the view (not with respect to the underlying collection).