Customize the use of alternate row colors in the rolled up data view

rated by 0 users
Answered (Not Verified) This post has 0 verified answers | 5 Replies | 4 Followers

Not Ranked
2 Posts
Points 61
boerjo1 posted on Fri, Apr 30 2010 1:00 PM |

To improve the visualization of the many rows shown a roll up data view, is there a way to alternate the row colors as is possible when viewing your own individual list?


All Replies

Top 150 Contributor
12 Posts
Points 40
ahodkin replied on Tue, May 4 2010 10:45 AM |

I too have an issue with this - rolling up multiple items, my first column has just a couple of words, my second column has potentially many lines. The rollup list appears to have a default vertical alignment of CENTER. This makes it extremely difficult to see where one item ends and the next begins. Any way of differentiating between items would be great - different colors as boerjo1 mentions here, or lines between items, or even being able to adjust the alignment would help...



Not Ranked
3 Posts
Points 66
David_S replied on Wed, Oct 20 2010 4:29 AM |


The answear is: Yes you can with SharePoint Designer. Set contitional formatting to row number Odd and add a background color to the row.

Not Ranked
2 Posts
Points 61
boerjo1 replied on Wed, Oct 20 2010 2:18 PM |

Hi David,


Thanks for providing a solution...Those folks at Bamboo have indeed not been of any help so far (read SILENCE).

Problem is that our corporation does not allow the use of SharePoint Designer which I understand would indeed solve a whole spectrum of formatting challenges. I was more looking for a creative solution within the roll-up web part itself as it does allow for some customization as provided by Bamboo themselves which made be believe that it would not be a big leap to alter the row colors.

Any suggestions?



Not Ranked
3 Posts
Points 66
David_S replied on Thu, Oct 21 2010 2:38 AM |

As far as I know SharePoint Designer is the only solution. Maybe some creative use of CSS in a content editor web part could work.

You can change some formatting  by changing the xslt-code in the webpart it self by using the "XSLT Editor" in the webpart but I don't know if it can make alterate row colors. Sorry.


Top 10 Contributor
1,824 Posts
Points 27,650
Answered (Not Verified) Julie Auletta replied on Wed, Nov 17 2010 3:39 PM |
Suggested by ahodkin

Sorry for the delay in our response to your posts. As David wrote, it is possible to change the xslt code for the List Rollup Data View, as long as you are using List Rollup Classic. The new List Rollup Web Part uses a different web part to display the aggregated data.

To change the xslt so every other row has a colored background - follow these steps:

  1. Edit your List Rollup Data View. From the tool pane, click the XSL Editor... button.
  2. When the Text Entry -- Webpage Dialog appears, copy all the text and paste it into Notepad (you can search in Notepad, but not in the Text Entry dialog). You might want to save a copy of this so you can put it all back the way you found it if you run into an error later.
  3. From Notepad, find the following text: <xsl:template name="dvt_1.body"> It should only appear once.
  4. Then find the first occurence of the text <tr> AFTER the <xsl:template name="dvt_1.body"> text. Paste the following text AFTER the <tr>:

    <xsl:attribute name="style">display: <xsl:value-of select="$GroupStyle" />;
      <xsl:if test="position() mod 2">background-color: #C0C0C0;</xsl:if>
  5. Replace the color #C0C0C0 (gray) with whatever color you prefer.
  6. Copy all the text from Notepad back to the Text Entry -- Webpage Dialog. Click Save on the dialog and then OK to save your web part edits. 

Let me know if this works for you.

Julie Auletta


Page 1 of 1 (6 items) | RSS
Bamboo Solutions Corporation, 2002-2016