Home > columns, hide, SharePoint > Show Hide SharePoint Columns Programmatically

Show Hide SharePoint Columns Programmatically


SPList rList = myweb.Lists[this.List.Title];

SPField field = rList.Fields["SubSites"];

Type type = field.GetType();


MethodInfo mi = type.GetMethod("SetFieldBoolValue", BindingFlags.NonPublic | BindingFlags.Instance);

mi.Invoke(field, new object[] { "Hidden", false });
mi.Invoke(field, new object[] { "CanToggleHidden", true });

field.Update();
Advertisements
Categories: columns, hide, SharePoint
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: