How to remove/delete a read only field programatically?
SPSecurity.RunWithElevatedPrivileges(
delegate
{
using
(SPSite spSite =
new
SPSite(
"siteurl"
))
using
(SPWeb spWeb = spSite.OpenWeb())
{
SPList list = spWeb.Lists["ListName"];spField.ReadOnlyField = false ;
spField.Update();
spField.Delete();
spField.ParentList.Update();
}
});
No comments:
Post a Comment