Monday, June 3, 2013

TIP: How to Change DVWP Column Titles

Introduction

There are a couple of ways in which you can change the title of a Data View Web Part column in SharePoint 2010.  You can simply select and delete the column title and then enter your own.  You can also take the more elegant approach and edit the XSL that generates the column title.  The latter approach will be shown here.  It employs SharePoint Designer 2010.

Procedure
  1. Using SharePoint Designer 2010, open the page containing the DVWP.
  2. In Code View, search for the following string:
    <xsl:call-template name="YourFieldTemplate"...
    
  3. Within this group, look for the following line:
    <xsl:with-param name="fieldtitle" select="fieldtitlename" />
    
    to
    <xsl:with-param... select="YourCustomFieldName" />
    
Summary

Happy Coding!

No comments: