0

I'm working on custom lists of sharepoint 2013.

I created many lists in each one I want to hide the standard column "Title" from visual studio . I know how to deal with this in SharePoint Site ( by making this field hidden in the column list ) , but every time I make changes in my list ( in visual studio) and deploy the project , the Title field becomes required.

Is there a way to force the "Title" standard column to "hidden" in visual studio ?

can anyone help me Please?

1

a coded solution.

what your talking about is the field that you want hidden!

SPField.Hidden()

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfield.hidden.aspx

and to get the field use:

Fields.GetFieldByInternalName()

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfieldcollection.getfieldbyinternalname(v=office.14).aspx

the title field becomes required and is a standard field part of any template list, so the first step through code would be to make it a none required field and then set it to hidden!

    using (SPSite site = new SPSite(http://thesiteurl:1234))
    {
       using (SPWeb web = site.OpenWeb())
       {
          SPList list = web.Lists["listName"];

          SPField spfield = list.Fields.GetFieldByInternalName("Title");

          spfield.Required = false;

          spfield.Hidden = true;

          spfield.Update();
       }
    }
  • I get the solution , it is just by making the standard field "Title" hidden using SharePoint designer – Rihab BEN CHHIBA Aug 5 '14 at 9:11
  • you want to do it in sharepoint desinger? thought you wanted to do it in visual studios? – Ali Jafer Aug 5 '14 at 10:22
0

When adding field elements to the list, or adding fieldref elements to a content type, you can add the following attributes to hide the column:

ShowInDisplayForm="TRUE" | "FALSE"

ShowInEditForm="TRUE" | "FALSE"

ShowInListSettings="TRUE" | "FALSE"

ShowInNewForm="TRUE" | "FALSE"

http://msdn.microsoft.com/en-us/library/office/aa543225(v=office.15).aspx

http://msdn.microsoft.com/en-us/library/office/ms437580(v=office.15).aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.