1

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

2

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

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

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
  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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