Archive for March, 2013

Data View WebPart – Format Any value-of select to wrap text

March 25, 2013

Latest “bang my head on the desk” moment was to wrap text in a data view web part. The XLST was modified to show conditional formatting and had columns I wanted, however modifying the width of the webpart, scrollbars appeared. Which is not what I nor the customer wanted.

To avoid this to show line of business data and/or any content from sharepoint, edit the XLST and change the span style for the particular value-of select column, e.g from:

<span>
<xsl:value-of select=”/dsQueryResponse/NewDataSet/Row/@title” />
</span>

To

<span style=”width:32px; overflow:auto; white-space:normal”>
<xsl:value-of select=”/dsQueryResponse/NewDataSet/Row/@title” />
</span>

Advertisements