There are some third party solitions, for example SPListDisplaySetting from CodePlex (not sure it will work for SP2010 though).
Another approach is to implement custom field type. You can find a detailed description here on InfoQ:
Also, you can try to customize list view, as described in Stefan Stanev's blog:
But actually, all these approaches are usually not enough secure. You can find they're acceptable for you, but be aware: usually the "secured" data could be easily revealed through:
- Data View (access-like ActiveX control)
- Document Information Panel (properties are shown for documents in Word)
- Custom list views or DataView webparts with custom datasources
- Direct request to ListService.svc or Lists.asmx web services
- SharePoint Search
So, the lookup-column approach seems to be a very good idea, because it uses OOTB security.
And this idea is appliable for salary field too, but you will need to write some extra code of course :)
- Add extra column of type
Single line of text
to your list, name it "Salary" with description "New salary value".
- Create lookup column "CurrentSalary" and point it to the Salaries list.
- Hide "CurrentSalary" from list forms
- Hide "Salary" from list views
- Add event receiver
ItemAdding
, and add code which do the following:
- Grab salary value from Salary field to some temp variable
- Clear the value from Salary field (!)
- Create a list item in Salaries list, and fill it with the salary value
- Apply appropriate permissions to the Salaries list item
- Point "CurrentSalary" column to the created list item
- Add similar
ItemUpdating
event receiver
So, you will have two columns: one "Salary" will only receive new values for salary, the other "CurrentSalary" will be not editable and will only display the salary value.