Template ControlCan Delete Property
This read-only property can be overridden to let a derived template allow or deny a request to delete
a row.
Definition
Namespace: EWSoftware.ListControls
Assembly: EWSoftware.ListControls (in EWSoftware.ListControls.dll) Version: 2024.12.31.0
Returns true to allow the delete, false to prevent it. If not overridden, it always returns true.
Assembly: EWSoftware.ListControls (in EWSoftware.ListControls.dll) Version: 2024.12.31.0
C#
public virtual bool CanDelete { get; }VB
Public Overridable ReadOnly Property CanDelete As Boolean
GetC++
public:
virtual property bool CanDelete {
bool get ();
}F#
abstract CanDelete : bool with get
override CanDelete : bool with getProperty Value
BooleanReturns true to allow the delete, false to prevent it. If not overridden, it always returns true.
Remarks
The row being deleted is always given the first chance to deny the deletion. If the row allows it, the data list raises its DeletingRow event to let the containing form have a chance to permit or deny the deletion.
There are advantages to putting delete confirmations within the template. It has direct access to its controls so it is easier to perform any necessary validation prior to allowing the deletion. If the template is used in many forms, it also saves you from having to add an event handler for the data list's DeletingRow event in each one too.