Share via


SPList.EnforceDataValidation - Propriété

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

Espace de noms :  Microsoft.SharePoint
Assembly :  Microsoft.SharePoint (dans Microsoft.SharePoint.dll)

Syntaxe

'Déclaration
Public Property EnforceDataValidation As Boolean
    Get
    Set
'Utilisation
Dim instance As SPList
Dim value As Boolean

value = instance.EnforceDataValidation

instance.EnforceDataValidation = value
public bool EnforceDataValidation { get; set; }

Valeur de propriété

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

Remarques

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.

Notes

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

Voir aussi

Référence

SPList classe

SPList - Membres

Microsoft.SharePoint - Espace de noms