Thursday, March 1, 2012

Custom Context Menu in SharePoint 2010

Hi All,

We know that sharepoint by default provides context menu option for "Title" field. What if we require a content menu for some other column other than "Title"?

In my case, I need to provide a context menu option for a thumb nail image.

The ViewFields section of picture library looks like this.

Here, I need the content menu for the viewfield "FieldRef Name='PreviewOnForm'/>".

To achieve this functionality, just add the below attributes after Name='PreviewOnForm'

"LinkToItem="TRUE" LinkToItemAllowed="Required" ListItemMenu="TRUE"" as shown below below.

This makes sure that we get a context menu when clicked on the 'PreviewOnForm' field as shown below

Cheers !

1 comment:

  1. It's really helpful in my projects..Thanks buddy keep going