Enable Context Menu in a Custom Column…


When you work with SharePoint Lists you may have noticed that you will get a small context menu for each list item. Usually this content menu show up in the first column. (Title or Name column). But recently I had a requirement to show this context menu for a Person (User Presence) column.

image

While I was wondering how to enable this option, I tried different methods to achieve this requirement. There is no way to enable this context menu from browser. (No UI option given to edit this). Because it failed from the browser I moved to SharePoint designer and tried to achieve this. When searching through internet I found that you can enable this option from SharePoint Designer.

Steps to Enable Context Menu from SharePoint Designer:

1) Navigate to the List that you have to do the customization.

2) Select the Modify View Option and then select Modify in SharePoint Designer.

image

(this will open up the list view in SharePoint Designer)

3) Select the Column that you need to add the context menu, then you will get a small > symbol indicating more options available.

image

4) Select the Check Box “Show List Item Menu”.

image

5) Save and now view the list from the browser.

image

You will see the context menu in the desired column. Smile

So what next. This Context Menu switch involved lot of manual steps. Is there any way to do this context menu switch from the Schema.xml file. (The file that holds the definition for a SharePoint List). That was my next question. So what I did was I saved this list as a template and then viewed the manifest file to check what changes has happened to the columns because of SharePoint Designer modifications.

image

While inspecting it showed up that we need to set this ListItemMenu attribute for the required field to “TRUE”. (The modification should be done to the FieldRef that is in Default View of the list)

I had spent about 1 and 1/2 day to figure how to enable this option. You usually miss this “ListItemMenu” attribute because it does not show up in the VS intellisense menu.

About these ads

5 thoughts on “Enable Context Menu in a Custom Column…

  1. Does anyone know how this can be done without using SharePoint designer or any other tool? i.e. just in Sharepoint 2007 itself. any assistance most appreciated

  2. Hi Sandeep,

    A really nice post, and thanks for sharing. As it says we can use the provided power shell script to enable the menu, after we have done the initial deployment. If you are going for a post deployment solution i think this would be a far more better way than going for a SharePoint Designer fix.

    But if you want to enable the menu from the initial deployment it self, then you can use the ListItemMenu=”True” schema attribute, as i have explained in the bottom section of this blog post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s