ASPxCardView.StartCardEditing Event
In This Article
Enables you to prevent a card from being edited.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
public event ASPxStartCardEditingEventHandler StartCardEditing
#Event Data
The StartCardEditing event's data class is ASPxStartCardEditingEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Cancel |
Gets or sets a value indicating whether the event should be canceled.
Inherited from Cancel |
Editing |
Gets the processed card’s key value. |
#Remarks
The StartCardEditing event occurs when an end-user has clicked the Edit command or the ASPxCardView.StartEdit method has been called. To prevent switching the ASPxCardView to edit mode, set the event parameter’s Cancel property to true
.
#Example
The code example below prohibits a user from editing cards that contain information unrelated to the Sales department.
string UserDepartment = "Sales";
...
protected void ASPxCardView1_StartCardEditing(object sender, DevExpress.Web.ASPxStartCardEditingEventArgs e)
{
if (ASPxCardView1.GetCardValuesByKeyValue(e.EditingKeyValue, "Department").ToString() != UserDepartment) {
e.Cancel = true;
}
See Also