Filtering by approval status in ContentByQueryWebPart

If you need to programmatically set properties on ContentByQueryWebPart to filter the data by approval status than FilterField is _ModerationStatus FilterType is ModState

webPart.FilterField1 = "_ModerationStatus";
webPart.FilterType1 = "ModStat";
webPart.FilterValue1 = "Approved";
Advertisements

3 thoughts on “Filtering by approval status in ContentByQueryWebPart

    • you can do something similar

      webPart.FilterField1 = “MyCustomField”;
      webPart.FilterType1 = “Text”; /* Assumption */
      webPart.FilterValue1 = “Approved”;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s