Skip to main content

Posts

Showing posts from October, 2012

Programmatically updating Validation Settings for list/library

Sometimes we might need to create, update or remove validation settings for the list or library:




This can be done by modifying the following members of SPList class:
ValidationFunction and ValidationMessage

Example:

SPList list = web.Lists["ListName"];
list.ValidationFunction = string.Empty;
list.ValidationMessage = string.Empty;
list.Update();