i have try to editing xlstviewwebpart for editing customize.but havnt getting any clues for my scenario.

i want to change title link in edit mode instead of display mode in webpart pages.

this view display in webpart page

when link on title's link its render in display mode

like this:

enter image description here

so i want to directly open in Edit mode. any one guide me plz?

2 Answers 2


There are several ways to achieve this.

I think the most preferrable way is to create a computed field.

1. Computed field

The point is, actually there are 5 "Title" fields in any SharePoint list:

enter image description here

First stores the data, the other 4 are Computed and simply generate some HTML, using data from the first column.

You can use similar approach and add your own computed field into the list, and then add it to the list view.

To add a computed field, you can use AddFieldAsXml method.

Example of using AddFieldAsXml for Computed field creation:

P.S. Most safe way to address edit form is to use ListForm.aspx page, as follows:


(PageType value goes from PAGETYPE enumeration)

2. XSL Transformation

Another option is to use XSLT capabilities of the XsltListViewWebPart. In this case, you need to write your xsl file, and attach it to the list view, for example by filling in SPView.XslLink property.


<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal" xmlns:o="urn:schemas-microsoft-com:office:office"> 

  <xsl:include href="/_layouts/xsl/main.xsl"/> 
  <xsl:include href="/_layouts/xsl/internal.xsl"/> 

  <xsl:param name="AllRows" select="/dsQueryResponse/Rows/Row[$EntityName = '' or (position() &gt;= $FirstRow and position() &lt;= $LastRow)]"/>
  <xsl:param name="dvt_apos">'</xsl:param>

  <xsl:template match="FieldRef[@Name='LinkTitle']" mode="Computed_LinkTitle_body">
      <xsl:param name="thisNode" select="." />
          <xsl:attribute name="href">/_layouts/listform.aspx?PageType=6&amp;ListId=<xsl:value-of select="$List" />&amp;ID=<xsl:value-of select="$thisNode/@ID" /></xsl:attribute>
          <xsl:attribute name="onclick">
                url: '/_layouts/listform.aspx?PageType=6&amp;ListId=<xsl:value-of select="$List" />&amp;ID=<xsl:value-of select="$thisNode/@ID" />'
              }); return false;
          <xsl:value-of select="$thisNode/@Title"/>

P.S. This code has been tested and works.

  • awesome solution!!! Thanx a lots for given guud direction as well as attach xsl script.Thanx for sharing your knowledge. May 15, 2012 at 9:29
  • Very nice explanation. Oct 28, 2012 at 3:00
  • The 2nd part helped me a lot with formatting SharePoint fields with XSLT. I couldn't find such concise XSLT usage example elsewhere. Thanks! Jul 30, 2014 at 21:09

Another possible option is if you open the view in designer and add your xsl elements there

Does anyone know anything about performance differences on the three ways on a large lists?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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