Content Query Web Part - How do you OrderBy when you QueryOverride?

Posted by Richard JP Le Guen on Stack Overflow See other posts from Stack Overflow or by Richard JP Le Guen
Published on 2010-03-26T14:38:03Z Indexed on 2010/04/11 20:23 UTC
Read the original article Hit count: 873

Filed under:
|
|
|
|

How do you order items when you override the QueryOverride property of the Content Query Web Part?

I have been given responsibility for a Web Part which extends the Content Query Web Part. The QueryOverride property of this Web Part is programmatically changed. Currently, the Web Part does not function as designed, as it does not order the items according to the appropriate field.

If I add an <OrderBy> node to the QueryOverride property I get an error message along the lines of 'something wrong with the query this web part is...' and the Content Query Web Part doesn't seem to have an OrderBy property which I could use instead.

The "QueryOverride property" part of this msdn article seems to suggest I should be able to add an <OrderBy> node to the QueryOverride but a number of web sites I've been reading suggest that this is not true.

So, wow do you order items when you override the QueryOverride property of the Content Query Web Part?

© Stack Overflow or respective owner

Related posts about sharepoint

Related posts about caml