I'm trying to hide the "Title" field in a list. This doesn't seem to work:
SPList myList;
...
SPField titleField = myList.Fields.GetField("Title");
//titleField.PushChangesToLists = true; <-- doesn't seem to make a difference
titleField.ShowInEditForm = false;
titleField.ShowInDisplayForm = false;
titleField.ShowInNewForm = false;
titleField.Update();
//myList.Update(); <-- make no difference
What am I doing wrong?
Go to the list or library where you want to show or hide columns. , then select Column Settings > Show/hide columns. In the Edit view columns pane, check (to show) or uncheck (to hide) the box for the column or columns as needed.
At the top of the form, select Edit form > Edit columns. In the Edit columns pane, check (to show) or uncheck (to hide) the checkbox for the column or columns as needed.
You can also hide a SharePoint Online list or document library by setting its permissions so that only specific users have access to it. Go to the List or Library settings page >> Click on the Permissions for this list link. Click on the 'Stop Inheriting Permissions' button.
Try this:
field.Hidden = true;
field.Update();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With