I am creating a Content Query Web Part as part of a feature receiver (feature activated), and adding it to a publishing page. The purpose is to filter on the Approval Status field for a Calendar event.
I can successfully filter the data returned by the CQWP by setting the following properties:
FilterField1 = "_ModerationStatus",
FilterOperator1 = ContentByQueryWebPart.FilterFieldQueryOperator.Eq,
FilterValue1 = "Approved",
FilterType1 = "ModStat",
But if I don't include _ModerationStatus in the AdditionalFilterFields, and you edit the web part, it just shows "no filter" "is equal to" "Approved" in the Additional Filters section of the web part properties.
However, and here is my problem, ANY field I add to the AdditionalFilterFields gets repeated if it's the last field added.
Example:
AdditionalFilterFields = "_ModerationStatus,Approval Status"
will show Approval Status three times in the drop down under "Show items when" in the tool part.
AdditionalFilterFields = "_ModerationStatus,Approval Status;Editor,Modified By"
will show Approval Status once, but the Modified By field three times in the drop down under "Show items when" in the tool part.
AdditionalFilterFields = "_ModerationStatus,Approval Status;Editor,Modified By,InstanceID,Instance ID"
will show Approval Status once, Modified By once, but the Instance ID field three times in the drop down under "Show items when" in the tool part.
Has anyone else encountered this issue creating CQWP's in code?