I'm adding some functionality to the ContentQueryWebPart by inheriting from ContentByQueryWebPart... but when I try and add a new WebPart Property, the actual field does not show up when I edit the webpart! Has anyone else tried this?

Here is an example of a property I am trying to add:

   [WebBrowsable(true), Personalizable(PersonalizationScope.Shared),     WebDisplayName("Page Filter Field"), 
    WebDescription("Enter the Page Field name which the CQWP will filter on"),

    public string PageFilterField
            return _pageFilterField;

            _pageFilterField = value;

1 Answer 1


You need to add a customised ToolPart for your property

public class CustomWebPart : ContentByQueryWebPart {
    public override ToolPart[] GetToolParts() {
        List<ToolPart> result = new List<ToolPart>(base.GetToolParts());
        result.Add(new YourCustomToolPart());
        return result.ToArray();

And for the ToolPart see here


  • Perfect!! Thanks for leading me down the right track. I used this link as an example to get my properties showing up: zimmergren.net/archive/2008/11/29/…
    – user424
    Commented Jan 17, 2011 at 2:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.