Showing posts with label Hiding Columns. Show all posts
Showing posts with label Hiding Columns. Show all posts

Monday, October 12, 2009

Hide Columns in SharePoint Part 2

Note : Before going to use this method you have to make sure all the columns are added to the list.Otherwise you have to remove the added custom form the SharePoint Designer (described in the post) and add it again after adding new column. It is better to use this way if you want hide and change control modes of fields. Also keep in mind to add at least one list item before use this method.

You can try SharePoint Tips Utility Pack if you are not sure whether you need to add columns in future or not.

In the first part of this post I discussed how to hide a column in SharePoint list. By using "Content Types" you cannot hide column in single form. Here I’m going to discuss how you can hide a column only in one (Edit, Display or New) mode using Microsoft SharePoint Designer 2007.

As an example I’m going to use the "Tasks" list and there I’ll remove "Due Date" column in Edit Mode.

First open your site using Microsoft SharePoint Designer 2007 as in Figure 1 (File --> Open Site…, in Site Name field give URL to your site without “default.aspx”. e.g. http://mysite:5050/testsite).

Then double click the displaying window and mark the "layout" hidden as in figure 2.

Then click once on area 1(Figure 3) and insert your custom list form. There select "Tasks" and "Edit item form", because we are going to change the edit form of task list (Figure 4).

Then select the row you want to hide and comment the HTML code (Figure 5).

Further if you want to display the raw in edit mode and you don’t want to allow editing it, you can change the Control mode property (Figure 6).

There keep in mind you can change control mode, if the column is not default one. That mean, to change the control mode using SharePoint Designer, you have to create your own column using "Settings –> Create Column".

Now save all and see, you will see the "Due Date" column is hidden and you cannot edit "Test Col" column (Figure 7).

Hide Columns in SharePoint Part 1

In SharePoint lists, sometimes we have to use hidden columns for our programming purposes. In this tutorial I’m going to discuss, how you can hide a column in SharePoint.

First let’s see how to hide a column in any list view. Here you should have permission to see some menus, if you cannot see them; you have to contact your administrator.

Open your list and go to List Settings (Figure 01).

At the bottom of the page select your view, which you want to hide a column (Figure 02). I'm going to select "All Items" view.

Then unmark all columns you want to hide in that view and click OK (Figure 03).

Now you can see, unmarked columns are not shown in "All Items” view.

Note : By selecting manage content type item in list settings, you can hide a column in New, Edit and Display forms. To do that go to the content type item and select the field you want to remove from your forms. Then choose “This column is hidden (will not appear in forms)”.

To hide a column in New, Edit or Display mode using Microsoft SharePoint Designer 2007 please refer second part of this post.