views:

1559

answers:

3

I'm wanting to have some data displayed on a SharePoint page which is essentially a Content Query WebPart, but with a few small changes:

  • Filter on a dynamic date
  • Paged Results

Is it possible to do the modifications by extending the existing one or is there a component out there which will do that?

+1  A: 

Try using the Data Form or Data View webpart. I believe it is more flexible in this regard. you may need to build a custom data source.

Nat
A: 

There is an open source project on CodePlex that extends the Content Query Web Part:

Enhanced Content Query Web Part

Lars Fastrup
+2  A: 

I also had a project that needed a Content Query web part with dynamic filtering. My solution was to extend the existing one (ContentByQueryWebPart class) similar to this blog post written by Andrew Connell.

My solution also included a custom "filter" webpart for dynamically changing the filter value to use in the extended Content query web part. This "filter" web part was basically a dropdown control that used javascript to reload the page with parameters added to the querystring. It worked perfectly.

I didn't implement any paging functionality to my custom Content Query web part, so I haven't tried this myself. After some searching I found this blog post by Waldek Mastykarz. He shows an example of how to implement paging by extending the Content Query web part. He also uses the queyrsting approach for passing parameter and I don't see any issues with integrating both paging and dynamic filtering in an extended Content Query web part.

Thomas Favrbo