Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a SharePoint 2010 list, which has attachments!!

I am using a custom grid-view to display some selected List fields from the list.

I would like to include the attachment as an embedded document in the Grid-view, Is that possible?

share|improve this question
    
Can you clarify what you mean by embedded document? Do you just want to include a link to the attachment in the grid? –  Kit Menke Nov 23 '11 at 15:15
    
@KitMenke I thought I will show the file in a cell, not the content. On double click of the file would like to open it in word document !! Is that possible? –  Jithu Nov 24 '11 at 4:47
add comment

1 Answer

up vote 2 down vote accepted

Assuming you're working in server side code:

Take a look a the Attachments property of the SPListItem, it returns an SPAttachmentCollection, from there itterate the SPFiles and use the Url property to get the site relative path and you should be sorted from there.

Some times the docs on MSDN are actually quite helpful :)

share|improve this answer
    
That was great Gavin :) Let me try this :) –  Jithu Nov 24 '11 at 8:31
    
Hi Gavin got this worked!! Created an Itemtemplate with anchor control to Image then set the HREF property of the anchor tab to the retrieved attachment URL ... –  Jithu Dec 2 '11 at 4:02
add comment

Your Answer

 
discard

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.