Good morning! I am trying to customize a CQWP through Visual Studio. More precisely, what I have done so far is:
- Add OOTB CQWP to page
- Customize Query and Presentation fields
CQWP is being displayed correctly. What I would like now is to be able to export this, or re-create a similar WP programmatically, so it can be packaged into a WSP and deployed on different environments.
What I have tried:
- Create a WP from scratch that inherits from
ContentByQueryWebPart
and programmatically set the WebUrl, ListGuid, ListName, among other properties on theCreateChildControls()
method - Instead of editing the cs file, I then tried customizing the .webpart
On both cases, after I add the WP to the page, I see that the configuration on the toolpart is correct. However, I don't see any content on the WP.
I also tried to export the OOTB WP, but I don't see how I am able to include this on a feature and deploy.
Any help would be greatly appreciated.
EDIT Added image below: First WP has been added through VS after exporting. Second one is OOTB Web Part