locked
How to enable default context menu in SPGridView RRS feed

  • Question

  • Hi Friends,

    I'm in need of developing a webpart that should display the logged in users' documents from all document libraries. Also need to fetch the relevant data for the queried documents from external application using webservices.

    Using SPSiteDataQuery, queried the logged in users' documents from all document libraries and displayed it in a SPGridView.

    • I would like to know how to enable the default context menu options. I referred to several blogs and found a way to add a new menu option using SPMenuField. Also got to know about core.js file. However I couldn't enable the default menu. Can someone please guide me how to include core.js file to my webpart ? Or is there anyother way to enable the default context menu ?
    • Also, I have a custom field in my document library. It fetches the data from external application for the appropriate document through webservice. I tried to include the field in my SPSiteDataQuery, but it dint return the value. Is there any solution for it ?
    • Instead using SPSiteDataQuery, Is it possible for me to use copy.asmx (sharepoint service) to copy documents from multiple libraries and display it in a document library format ? Please guide me on this.

    Thanks in advance !



    • Edited by Arun_KnS Tuesday, August 7, 2012 11:15 AM
    Tuesday, August 7, 2012 11:10 AM

Answers

  • Hi Arun,

    From your description, you said default context menu, do you menu the context ribbon and ECB menu in the document libraries? If so, grid view by default doesn’t contain a menu like this.

    As you want the context menu, do you mean that you want to update the items in the grid view? if so, you may consider customizing buttons on the grid view. Using copy web service or other method to copy the file to another library is just creating new items in libraries, the created, created by fields are changed to new values, and changes to them will not reflect the original ones.

    Thanks,


    Qiao Wei

    TechNet Community Support

    • Marked as answer by Qiao Wei Friday, August 17, 2012 10:10 AM
    Monday, August 13, 2012 9:23 AM