SharePoint Hidden Column
Posted on 2011-02-16
I'm trying to hide a column in SharePoint 2007 in a document library. The column needs to be hidden so that users cannot update the field, but it needs to be visible in the default view. That is the easy part and I've successfully done that.
However, my problem arises when I try to edit a document via C# code using the SharePoint dlls. My code is as follows:
foreach (SPFile document in docLibrary.Files)
string name = document.Properties["MyColumn"];
when the column is hidden, it is null. However, when it's optional, it returns the default value.
How can I hide this column from users but still be able to update it in code? Thank you!