How To : Set calculated field to read-only using Object Model

(A) Create an EventHandler using the ClassLibraryTemplate in the visual Studio 2005. using Microsoft.SharePoint; public class [ClassName] : SPListEventReceiver { public override void FieldUpdating(SPListEventProperties properties) { properties.ErrorMessage = “You can’t changed the column.”; properties.Cancel = true; } } (B) Register the Event Handler using the following Code. // http://tangov39:47242/sites/TestCase/ is the site URL. SPSite collection…

1