in

SharePoint University

Clean slate. Nothing but SharePoint.
Go, SharePoint!

How to make a sharepoint list column readonly/invisible within sharepoint UI

Last post 10-05-2007 2:02 AM by arun_gp. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-04-2007 4:53 AM

    How to make a sharepoint list column readonly/invisible within sharepoint UI

     Hi Everybody,

    I have created a list in sharepoint. In that list there is a field which I want to make read only or invisible when the user tries to add or edit a list item through sharepoint UI. I want this because that particular field gets populated through a webpart and direct data entry into that field is unnecessary. Is there any way to make a sharepoint column (for me its a picture column) read only or invisible in the sharepoint UI.

    thank you,

    Arun Dutt

  • 10-04-2007 6:09 AM In reply to

    Re: How to make a sharepoint list column readonly/invisible within sharepoint UI

    Try going to the list settings, click on the collumn, then choose hide collumn.

  • 10-05-2007 2:02 AM In reply to

    Re: How to make a sharepoint list column readonly/invisible within sharepoint UI

    Hi donsdgr81,

    thanks for the reply. But I wanted to do the job through C# code.  

    I found a solution. here it is...


    The properties ShowInNewForm and ShowInEditForm did the job for me.

    string newField = "<Field Type=\"URL\" ShowInNewForm=\"FALSE\" ShowInEditForm=\"FALSE\" DisplayName=\"NotesIcon\" Format=\"Image\" Name=\"NotesIcon\"/>";
                        fields.AddFieldAsXml(newField, true, SPAddFieldOptions.Default);

     

    Thanks and regards,

    Arun Dutt

    Software Engineer, OptimusBT-India


     

Page 1 of 1 (3 items)

Need SharePoint Training? Attend a SharePoint Bootcamp!
Forum content (c) original posters. Everything else (c) 2008 SharePoint Experts, Inc.