0

I am creating a webpart which queries all lists of content type "A". The query will work on the lists located on the site the webpart is currently being loaded from and all sub sites. I have been able to accomplish this without a problem in a Content Query Webpart as well as CAML Query. However in a content Query Webpart I am able to group the results by the site (displayed as in the dropdown list) the list corresponds to. As for doing this same thing using CAML, I am not able to groupby the site (I havent been able to find out what value to put inside the groupby tags). Any help would be greatly appreciated. Thanks in advance!

Ex.

<groupby>
What goes here?
</groupby>
Orlando
  • 935
  • 2
  • 20
  • 42

1 Answers1

0

So it seems you cant use a groupby in a QueryOverride... The way to achieve this is use the QueryOverride to do the Where and OrderBy then export the webpart and modify the XML. Change the value which should be:

<property name="GroupBy" type="string" />

to

<property name="GroupBy" type="string" >ColumnName</property>

in my case since i want to group by sites the ColumnName would be ProjectProperty.Title

Leaving the final code looking like this:

<property name="GroupBy" type="string" >ProjectProperty.Title</property>

Hope this helps someone!

Orlando
  • 935
  • 2
  • 20
  • 42