SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I change the column in a SharePoint list that has the link to the item and the link to the item with edit menu eg:

Title (linked to item) Title (linked to item with edit menu)

I want to have a different column with the link. I want to do this without any workaround like renaming the Title to the other column that I want and copying the content into it.

Thanks

share|improve this question
up vote 20 down vote accepted
  1. Open the AllItems.aspx page for the specific list.
  2. Search for the <ViewFields> tag
  3. List item LinkToItem="TRUE" to whichever column you want the link:

<ViewFields><br/>
    <FieldRef Name="Attachments"/><br/>
    <FieldRef Name="LinkTitle"/><br/>
    <FieldRef Name="linkThisColumn" LinkToItem="TRUE"/><br/>
    <FieldRef Name="data_x0020_column"/><br/>
    <FieldRef Name="Another_x0020_column"/><br/>
</ViewFields><br/>
share|improve this answer

If you're trying this for SharePoint 2013, change "LinkToItem" to "linkToItem"

<ViewFields><br/>
    <FieldRef Name="Attachments"/><br/>
    <FieldRef Name="LinkTitle"/><br/>
    <FieldRef Name="linkThisColumn" linkToItem="TRUE"/><br/>
    <FieldRef Name="data_x0020_column"/><br/>
    <FieldRef Name="Another_x0020_column"/><br/>
</ViewFields><br/>
share|improve this answer
    
Note: If you Modify View after this through UI (Library>Modify View) attribute will be lost in AllItems.aspx page. – eVT May 4 '15 at 8:40

Do you try this solution? In this solution you should modify field declaration on a view through SharePoint Designer.

You can hide the “Title” field first by going to List Settings > Advanced Settings > Content Types > set Allow Management of Content Types to Yes. This will open Content Types under the List Settings.

Then go back to the List Settings > Content Types > click on Title and set it to Hidden.

Now to link the Item to a specific column/field, you need to open the list in SPD and look for the following tags:

<ViewFields>
<FieldRef Name="Field1"/>
<FieldRef Name="Field2"/>
<FieldRef Name="Field3"/>
<FieldRef Name="Field4"/>
<FieldRef Name="Field5"/>

Let’s say you want the Item to open when you click on “Field1″. Just add LinkToItem=”TRUE” tag on it:

<ViewFields>
<FieldRef Name="Field1" LinkToItem="TRUE"/>
<FieldRef Name="Field2"/>
<FieldRef Name="Field3"/>
<FieldRef Name="Field4"/>
<FieldRef Name="Field5"/>

Save it and you’re done.

share|improve this answer
    
That does the trick, thanks – Carel Dec 7 '12 at 12:08
2  
The link is dead :( – Alexey Krasheninnikov Feb 21 '15 at 8:53
2  
Wayback machine helps @AlexeyKrasheninnikov :) web.archive.org/web/20130305011257/http://jedmallen.com/… – moe Mar 11 '15 at 16:58
    
@AlexeyKrasheninnikov - the link eventually being dead is why I added the content of the link into an answer above – Carel Jan 11 at 7:39

You can use LinkToItem, LinkToItemAllowed and ListItemMenu properties of SPField. If you want field to show link to item's display form you need to set LinkToItem property to true and LinkToItemAllowed property to Allowed. If you want to add context menu to field you need to set ListItemMenu to true.

share|improve this answer

protected by Community Oct 30 '14 at 13:30

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.