Add fields view to a ContentByQueryWebParts RRS feed

  • Question

  • Hello,

    I need to build a ContentByQueryWebParts using object model. Everything works fine except that I did not find how to add fields of the content type. I must do it programmatically.



    Tuesday, January 15, 2013 4:43 PM


All replies

  • Check out these posts

    To add fields to content type check this out


    If you are looking for adding columns to view field check the enhance content query webpart, you can reuse the code




    Hope this helps

    Raghavendra Shanbhag | Blog: www.SharePointColumn.com
    Please click "Propose As Answer " if a post solves your problem or "Vote As Helpful" if a post has been useful to you.
    Disclaimer: This posting is provided "AS IS" with no warranties.

    Tuesday, January 15, 2013 6:24 PM
  • Hi Indul,

    Request you again please do not self propose your answers also please do not copy and paste the whole content of any webpage. Your shared content is whole webpart of this below link. It will be best if you can just share the link rather than pasting the whole content.


    Thanks, Ali Yasir

    Wednesday, January 16, 2013 5:53 AM
  • Hi Charles,

    Have a look at the following thread to try to use query.viewfields.


    Best Regards.

    Kelly Chen
    TechNet Community Support

    Wednesday, January 16, 2013 8:26 AM