Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

SPList.EnforceDataValidation Property

Gets or sets a value that indicates whether certain field properties are enforced when an item is added or updated.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

public bool EnforceDataValidation { get; set; }

Property Value

Type: System.Boolean
true to enforce field properties; otherwise, false.

If the value of the EnforceDataValidation property is true, then the following conditions must be met:

  • If the Required property of any field in the item is set to true, then the field must have a value.

  • If an SPFieldNumber object in the item has values in the MinimumValue and MaximumValue properties, then the field value must be within the specified bounds.

  • If an SPFieldChoice object in the item has the FillInChoice property set to true, then the field value must be one of the strings in the field's Choices collection.

If any one of these conditions is not met, then an SPListDataValidationException is thrown.


The type of validation controlled by this property is independent of validation that uses the formula set in the ValidationFormula property.

© 2015 Microsoft