locked
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.

    Thanks,

    Charles

    Tuesday, January 15, 2013 4:43 PM

Answers

All replies

  • Check out these posts

    To add fields to content type check this out

    http://web4u000.wordpress.com/2008/06/09/creating-content-types-in-sharepoint-through-code-c/

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

    http://ecqwp.codeplex.com/

    http://www.sharepointnutsandbolts.com/2007/06/extending-content-query-web-part.html

    http://imtech.codeplex.com/releases/view/12511

    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.

    http://blogs.perficient.com/microsoft/2007/12/enhancing-the-contentbyquerywebpart-part-1/


    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.

    http://sharepoint.stackexchange.com/questions/43615/how-to-to-add-a-content-query-webpart-programatically-and-use-a-spsitedataquery

    Best Regards.


    Kelly Chen
    TechNet Community Support

    Wednesday, January 16, 2013 8:26 AM