locked
problem while deleting a column from site content type RRS feed

  • Question

  • hi,

    I am using sharepoint 2007 .

    1)I have created a content type with parent type item,

    2) Added 2 columns FN and LN

    3) so now I have 3 columns, (title, FNand LN)

    4) I want my content type should have only 2 columns (FNand LN)

    5) I am not geeting any option to delete column (Title) of parent content type

     

    I want to delete column (Title) of parent content type,  any ideas ??

    • Moved by Mike Walsh FIN Wednesday, March 16, 2011 9:10 AM Admin q - do not post everything to General (From:SharePoint - General Question and Answers and Discussion (pre-SharePoint 2010))
    Wednesday, March 16, 2011 8:10 AM

Answers

  • Hi,

    In OOTB there is no option of deleting the Title Column from the ContentType which is inherit from a parent content Type.

    A work around is.

    Go the your Content Type in the content Type galleries.

    Click the Title column.

    Make it as Hidden.

    Go to the List Which uses this content type. 

    Modify the View 'AllItems'. Remove the Title from the View.

     

    Programatically if you want to remove the title column means here is the way.

    SPContentType contentType = web.ContentTypes["Custom"];
    
    if (contentType.Fields.ContainsField("Title") == true)
     {
       contentType.FieldLinks.Delete("Title");
       contentType.Update();
     }
    

     


    R.Mani http://rmanimaran.wordpress.com
    • Marked as answer by Prashanth.net Wednesday, March 16, 2011 2:05 PM
    Wednesday, March 16, 2011 8:34 AM

All replies

  • Hi,

    In OOTB there is no option of deleting the Title Column from the ContentType which is inherit from a parent content Type.

    A work around is.

    Go the your Content Type in the content Type galleries.

    Click the Title column.

    Make it as Hidden.

    Go to the List Which uses this content type. 

    Modify the View 'AllItems'. Remove the Title from the View.

     

    Programatically if you want to remove the title column means here is the way.

    SPContentType contentType = web.ContentTypes["Custom"];
    
    if (contentType.Fields.ContainsField("Title") == true)
     {
       contentType.FieldLinks.Delete("Title");
       contentType.Update();
     }
    

     


    R.Mani http://rmanimaran.wordpress.com
    • Marked as answer by Prashanth.net Wednesday, March 16, 2011 2:05 PM
    Wednesday, March 16, 2011 8:34 AM
  • Hi Prashanth,

    Title column is default column in list. You can't delete it but rename column name or the best way to get rid of it is to hide it .

    To hide Title column follow below steps

    1. Go to Your list settings on which you want to hide/remove title column.
    2. Go to advanced settings of that list.
    3. Click on yes at very first option. Allow management of content types.
    4. Once you do this, one more setting panel becomes visible in advanced settings options. 
    5. Now click on that Item content Type.
    6. As you can see here you will find all columns are listed along with Title column.
    7. Click on that Title column. 
    8. Select the last radio button which is Hidden.
    9. Save all settings and then go back to list and click on new Item and see... now Title column is no more there....

    Make sure that you also remove all reference of Title column from views because it is hidden now but still it will be there in views.

     


    Warm Regards, Pratik Vyas | SharePoint Consultant | http://sharepointpratik.blogspot.com/
    • Edited by Pratik Vyas Wednesday, March 16, 2011 8:38 AM add
    Wednesday, March 16, 2011 8:37 AM