Home > Microsoft SharePoint 2010 > Content Query Web Part Custom column not available in Sort By

Content Query Web Part Custom column not available in Sort By

In one of my SharePoint 2010 project, I have multiple lists which are of custom content type.

I am using  CQWP in one of my web part page to query data with custom content type and I want that result to be in sorted order using one of the custom column value.

When setting the properties of Content Query Web Part I was not able to select my custom column in the Sort By drop down box as it is not listed there. After googling I found that I could override the query by exporting the web part and adding my CAML query to override the query using ‘QueryOverride’ property of the web part. But found that once you override the query all other filters which is set by GUI is removed so we need to include all other columns in CAML query , which is tedious for me as for only one custom column I need to rewrite the whole CAML query.

After looking the issue with different angles and researching I found the issue,I used content query web part to query data using custom content type but I have added the columns in list.

To make it work I have removed the columns from list and added them to content type after this the custom columns are available in Sort By dropdown and my issue is resolved.

Hope this will help you also.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: