Interface IEditableCollectionView
IEditableCollectionView is an interface that a collection view can implement to enable editing-related functionality.
Namespace: System.ComponentModel
Assembly: OpenSilver.dll
Syntax
public interface IEditableCollectionView
Properties
| Improve this Doc View SourceCanAddNew
Return true if the view supports AddNew().
Declaration
bool CanAddNew { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
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 System.ComponentModel.IEditableObject, or if the view has special knowledge about the item that it can use to support rollback of pending changes.
Declaration
bool CanCancelEdit { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
CanRemove
Return true if the view supports Remove(Object) and RemoveAt(Int32).
Declaration
bool CanRemove { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
CurrentAddItem
When an AddNew() transaction is in progress, this property returns the new item. Otherwise it returns null.
Declaration
object CurrentAddItem { get; }
Property Value
Type | Description |
---|---|
System.Object |
CurrentEditItem
When an EditItem(Object) transaction is in progress, this property returns the affected item. Otherwise it returns null.
Declaration
object CurrentEditItem { get; }
Property Value
Type | Description |
---|---|
System.Object |
IsAddingNew
Returns true if an AddNew() transaction is in progress.
Declaration
bool IsAddingNew { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsEditingItem
Returns true if an EditItem(Object) transaction is in progress.
Declaration
bool IsEditingItem { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
NewItemPlaceholderPosition
Indicates whether to include a placeholder for a new item, and if so, where to put it.
Declaration
NewItemPlaceholderPosition NewItemPlaceholderPosition { get; set; }
Property Value
Type | Description |
---|---|
NewItemPlaceholderPosition |
Methods
| Improve this Doc View SourceAddNew()
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.
Declaration
object AddNew()
Returns
Type | Description |
---|---|
System.Object |
CancelEdit()
Complete the transaction started by EditItem(Object). The pending changes (if any) to the item are discarded.
Declaration
void CancelEdit()
CancelNew()
Complete the transaction started by AddNew(). The new item is removed from the collection.
Declaration
void CancelNew()
CommitEdit()
Complete the transaction started by EditItem(Object). The pending changes (if any) to the item are committed.
Declaration
void CommitEdit()
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.
Declaration
void CommitNew()
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.
Declaration
void EditItem(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item |
Remove(Object)
Remove the given item from the underlying collection.
Declaration
void Remove(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item |
RemoveAt(Int32)
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).
Declaration
void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |