SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We use SharePoint and DVWP for getting items from InfoPath Form library. In DVWP we enabled 4-level grouping. And rows with group headers looks like this:

  • Month: Value
    • Type: Value
      • Category: Value
        • Subcategory: Value

And this looks good except behavior when one of grouping fields contains blank values. In this case - we can see expanded grouping rows with group headers which looks like "field_name: " except "field_name: value".

Is it possible (with jQuery or with XSL) to hide this rows (which contain group header with blank field value) from DVWP?

Any help will be appreciated.

share|improve this question
up vote 0 down vote accepted

I assume that you just want to remove the grouping header row and not the items in the grouping. I think that addressing this directly in XSL would be the best way. In your XSL template, add a validation against the group field value (should be $fieldvalue)

You can put this in your specific grouping template :

<xsl:if test="$fieldvalue != ''"> <!-- grouping header --></xsl:if>

or in the body template :

<xsl:if test="$groupheader0 != ''"> 
    <xsl:call-template name="dvt_1.groupheader0">
    <!-- params -->


Month: July




Month: July


share|improve this answer
This is exactly what I want. Thank you very much! – user18523 Jul 29 '13 at 9:35

Your Answer


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.