SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

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

I have a custom job that creates a view. In my custom view I want to display the column with the "linked to item type".

Please guide..

Thanks in advance

share|improve this question

When you add the FieldRef inside the ViewFields add an Attribute LinkToItem="TRUE"

 <FieldRef Name="DocIcon"/>
 <FieldRef Name="Filename"/>
 <FieldRef Name="Modified" LinkToItem="TRUE"/>
 <FieldRef Name="Editor"/>

If you're creating the view programatically then unfortunately there is no way to set this attribute through the SPViewFieldsCollection returned by SPView.ViewFields.

So you have to:

  1. do all of your setup in code
  2. call SPView.GetViewXml
  3. do string manipulation to add the attribute
  4. call SPView.SetViewXml
share|improve this answer
Thanks @Per Jakobsen for ur answer. But I am not getting where should I write this code. I am creating the view by C# code. Can you please tell me where should I include this in my code. – Mansi Desai Mar 27 '12 at 4:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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