How to show attachment with List item in separate column.

Today I got the client requirement to display item attachment in List view.I am going to present the steps to display item attachment into SharePoint 2010 List view.

1) Open SharePoint List view in SharePoint Designer.

2) Open SharePoint list > Under View > Right click on Target View File in my case it is “All Items” and select “Edit File in Advanced Mode ” .

3) Select the view and create new column titled Attachment.

4) Select TD tag of New column.

5) And Replace the selected TD tag to below code.

<strong><td</strong>id="ItemAttchment"class="ms-vb"<strong>>/strong>

<strong><xsl:element</strong>name="SharePoint:AttachmentsField"<strong>&gt;</strong>

<strong><xsl:attribute</strong>name="runat"<strong>&gt;</strong>server<strong>&lt;/xsl:attribute&gt;</strong>

<strong><xsl:attribute</strong>name="FieldName"<strong>&gt;</strong>Attachments<strong>&lt;/xsl:attribute&gt;</strong>

<strong><xsl:attribute name="ControlMode"<strong>&gt;</strong>Display<strong>&lt;/xsl:attribute&gt;</strong>

<strong><xsl:attribute name="Visible"<strong>&gt;</strong>true<strong>&lt;/xsl:attribute></strong>

<strong><xsl:attribute</strong>name="ItemId"<strong>></strong>

<strong><xsl:value-of select="$thisNode/@ID"/></strong>

<strong></xsl:attribute></strong>

<strong></xsl:element></strong>

<strong></td></strong>

6)  The final output will like below :

FinalImage

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s