<p>I've built a web part for Sharepoint that retrieves data from an external service.  I'd like to display the items in a way that's UI-compatible with Sharepoint (fits in with its surroundings.)</p>

<p>I'm aware of the "DataFormWebPart" but was unable to get one working properly.  It requires a valid DataSource and I was unable to build one from the results of a web service call... Part of the problem is that my web service wrappers don't expose the XML return info, rather I have a bunch of deserialized objects.  There doesn't seem to be an easy way to turn actual objects into a datasource, or populate a "generic" datasource from object data.</p>

<p>I could use an SPGridView to get the same UI, but the grid control doesn't have much in the way of smarts -and- it forces every field into its own column.  I'd prefer to render each list item as a single cell with complex rendering (for instance the way that StackOverflow shows its lists of questions.)  I'd also like to get as much of the Sharepoint-standard UI as possible, such as the sorting, filtering, and paging controls.</p>

<p>So, first: Has anyone here written a Sharepoint control that does this, and if so do you have sample code to share?  If not: am I overlooking some useful control, whether MS-supplied or available in an external library?</p>

<p>Thanks!
Steve</p>

[{'answer_id': 76981, 'author': 'Nat', 'author_id': 13813, 'author_profile': 'https://Stackoverflow.com/users/13813', 'pm_score': 0, 'selected': False, 'text': '<p>Problem with SharePoint is that there are a bunch of different ways to do this. If your data is not changing too often and is not overly large it may be worth considering entering it into a list for display.\nIf you have the Enterprise licence it may be worth getting your data into the BDC and using it there. \nyou may have to convert the objects into xml or use the serialised objects with the XML webpart for display. This still has the issue of custom rendering using XSLT.</p>\n'}, {'answer_id': 78305, 'author': 'sachaa', 'author_id': 1152057, 'author_profile': 'https://Stackoverflow.com/users/1152057', 'pm_score': 0, 'selected': False, 'text': '<p>Here\'s a great article that explains how to configure BDC connections to web services using the BDC Definition Editor:</p>\n\n<p><strong>Creating a Web Service Connection by Using the Business Data Catalog Definition Editor</strong>\n<a href="http://msdn.microsoft.com/en-us/library/bb737887.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/bb737887.aspx</a></p>\n'}, {'answer_id': 79548, 'author': 'naspinski', 'author_id': 14777, 'author_profile': 'https://Stackoverflow.com/users/14777', 'pm_score': 0, 'selected': False, 'text': '<p>The best way to do this IMO is to make a Web Part.  As a Web Part the UI will be automatically rendered to be the same as the theme the site is using (unless you override it) and it will be able to be placed anywhere by anyone with admin privileges.</p>\n\n<ul>\n<li><a href="http://www.naspinski.net/post/WSS-30MOSS-2007-Web-Part-Tutorial.aspx" rel="nofollow noreferrer">Tutorial on making a Web Part</a></li>\n<li><a href="http://naspinski.net/post/Packaging-and-Deploying-a-SharePoint-2007-Web-Part.aspx" rel="nofollow noreferrer">Tutorial on packaging and deploying a Web Part</a></li>\n<li><a href="http://naspinski.net/post/Free-SharePoint-2007-Web-Part-Time-Zones.aspx" rel="nofollow noreferrer">Example Web Part Source Code</a></li>\n</ul>\n'}, {'answer_id': 79624, 'author': 'Mashed Potato', 'author_id': 14396, 'author_profile': 'https://Stackoverflow.com/users/14396', 'pm_score': 3, 'selected': True, 'text': '<blockquote>\n  <p>Sharepoint: Best way to display lists\n  of non-Sharepoint content with\n  “compatible” UI?</p>\n</blockquote>\n\n<p>Take a look at the built in sharepoint web controls:</p>\n\n<p><a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.aspx" rel="nofollow noreferrer">Microsoft.SharePoint.WebControls Namespace</a></p>\n\n<p>It contains all the controls used in sharepoint.  I\'d tell you more, but the documentation is very thorough.</p>\n'}, {'answer_id': 638211, 'author': 'LeonZandman', 'author_id': 76220, 'author_profile': 'https://Stackoverflow.com/users/76220', 'pm_score': 0, 'selected': False, 'text': '<p>You could create a custom web part and use an SPGridView. You say you don\'t like it, because it forces every field into its own column, but that\'s not true. You can create a template (ITemplate) for every column and fully customize what\'s shown inside it, just like you would using a normal ASP.Net GridView. Using this approach I\'ve added the little "New" images right next to a list item\'s Title, just like SharePoint does itself.</p>\n'}]
['https://Stackoverflow.com/questions/75747', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7104/']