How to: Prohibit a User from Editing Cards Containing Specific Information

The code sample below demonstrates how you can prohibit a user from editing cards containing 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;
}