I am building a custom visual webpart where I want to show all the calendar events across a site using SPSiteDataQuery. I know I can use asp.net repeater or grid view to show the data but I was wondering if there is a SharePoint data control I can leverage to have all the functionalities a list view webpart has (ecb/context menu, sorting, paging, etc). Any help will be appreciated.



SPGridView, its just like List View...


You can instantiate a ListViewWebPart in a visual web part.

Here's an example posted on this site:

How to extend a ListView WebPart (from code)

And here's a blog post with examples on how to perform the second option:

Create Custom ListViewWebPart

  • +1, sadly, ListViewWebPart is sealed. However both links are great and I can recommend them.
    – ppatalong
    Nov 20 '12 at 20:15
  • Reflection my friend. Nov 20 '12 at 20:30

Interestingly, I see there's a ListViewByQuery Web Part here. I'll be trying it out to see if it does what I need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.