To put this in context, what I need to do to complete work on a custom action is to hide a particular column from users who aren't members of a given group. Given that the custom action is implemented with C# code, I'm looking for a tidy way to do this programmatically.
For a brief moment, it looked like a single line of code would do the trick:
SPContext.Current.List.DefaultView.ViewFields.Delete("Name Of Column I Want To Hide");
Even though the view seems to change internally, this statement seems to have no effect.
There are a few available examples that use ViewFields.Delete, but they're all followed by calls to ViewFields.Update() - in other words, they presume that you want to permanently remove the column. But I just want to remove it for the current context.
Can anyone here enlighten me as to what tactic might work in this case?
Thanks in advance Josh