SharePoint Data Control to show Custom Data Source
-
09-12-2019 - |
Question
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.
Thanks!
Solution
SPGridView, its just like List View...
OTHER TIPS
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:
Interestingly, I see there's a ListViewByQuery
Web Part here. I'll be trying it out to see if it does what I need.