0

Is it possible to apply filtering to some columns in a Data View Web Part but not others? I have a Data View Web Part configured as a crosslist rollup returning data from a parent and multiple child sites. I would like to apply different filters to some of the columns but not all. My experiments so far have resulted in an all or nothing scenario (i.e. filter applied to all columns or none). Can I add the filter to my select statement perhaps?

Any examples would be appreciated and thanks in advance for your time!

1

Try the grouping toolbar feature that is built-in to the DVWP. Instead of "Sort & Filter on Headers" in the Design ribbon, you can use the Options drop-down in the Design ribbon and then tick "Grouping Toolbar".

This will add XSLT to the DVWP that contains drop-downs for each column. You can edit the XSLT and remove the drop-downs you don't want. Using Design View it is pretty easy to identify which elements to remove and which to keep.

  • Thanks so much for your suggestion Teylyn! I investigated grouping but I wanted to filter the values before they were returned. After more XSLT research I discovered I can use contains to pass the filter in my query as follows: xsl:value-of select="@fieldname1[contains(@fieldname2, 'compare value1') or contains(@fieldname2, 'compare value2') and contains(@fieldname3, 'compare value3')]" The result is a column or cell level filter in your DVWP. – Kms Feb 7 '14 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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