Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Hide site columns inside my farm solution

$
0
0

I have an issue tracking list , and I want certain fields to be shown only if the user is inside a group named “Managers”.

So I wrote the following farm solution inside visual studio, which i will add to my Edit form:-

protectedoverridevoidOnInit(EventArgs e){base.OnInit(e);InitializeControl();using(SPSite site =newSPSite(SPContext.Current.Site.Url))using(SPWeb web = site.OpenWeb()){SPGroupgroup= web.Groups["Managers"];bool isUser = web.IsCurrentUserMemberOfGroup(group.ID);if(isUser){//what should I write here}}}

But I am not sure how I will be hiding the columns in my if statement ? can anyone advice how can i reference specific site column in my above code ?

Thanks


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>