Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I would like to format columns or rows that contain certain values, without any client side javascript hacks. I'm looking for an OOB solution.

For example - if 1 column in my list being of type boolean (yes/no) contains a no valid - I would like to change the background color of the row.

Or if a column contains a text field, and let's say with the value of "Not updated" - I would like to change the font in that column to #ff0000;

Last example would be to check a date range, and if a column in the list (date column) has a value that meets certain criteria then so some or other styling to the row or a specific column.

Is any of this possible?

share|improve this question
    
Are you willing to consider a 3rd party solution, or making your own Custom Field Type? –  Stuart Pegg Oct 17 '11 at 19:03
add comment

2 Answers 2

up vote 3 down vote accepted

As Lori says, because this is XSL-based you have several options. I can think of three ways to get your XSL in place off the top of my head:

  1. Edit in SharePoint Designer 2010 and do some 'conditional formatting'. This will in effect embed the XSL in the web part.

  2. Put your XSL in a separate file and use the XSL Link property to add it to the web part. One advantage of this is that it can be re-used across several web parts. I've blogged on this XLV Override Technique previously, including an example based on a out of the box tasks list.

  3. Deploy some XSL to the file system, making use of the extensibility of the fldtypes_*.xsl technique - similar to as if making a completely custom field type. This is a useful approach if you'd like your formatting to be applied universally without having to worry about configuring specific web parts - and can even be targeted at specific columns and/ or lists.

HTH

share|improve this answer
    
+1 for the list of options and decent blog post, but look, have you actually tried the 3rd option yourself (with fldtypes_*.xsl)? It doesn't work for me and I heard from my fellows about the same issue. –  Andrey Markeev Oct 17 '11 at 22:52
    
Hi Omlin - yes I've tried option 3. I've done this to target a specific column on a list by targeting the column name and the list ID. –  GlynClough Oct 18 '11 at 7:57
add comment

Since list views in SharePoint 2010 are XSL list views, you can apply conditional formatting to them through SharePoint Designer, just like you can with Data View Web Parts.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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