views:

1102

answers:

6

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

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.

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.

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?

Thanks! Steve

A: 

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. If you have the Enterprise licence it may be worth getting your data into the BDC and using it there. you 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.

Nat
Thanks Nat. The external data is large (external search results) so it's not possible to keep it as a new list. We're a SharePoint plugin so I can't guarantee that the BDC will be available at all installations. I guess I'm kind of out of luck with your suggestions but I appreciate the answer!
Steve Eisner
A: 

Here's a great article that explains how to configure BDC connections to web services using the BDC Definition Editor:

Creating a Web Service Connection by Using the Business Data Catalog Definition Editor http://msdn.microsoft.com/en-us/library/bb737887.aspx

Sacha
Unfortunately I need something a little different: I'm building a web part that needs to display live results of a web service call - it's not part of the regular search results. Thanks though, it's a very useful link for something else I'm working on which does involve modifying the search page!
Steve Eisner
A: 

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.

naspinski
Steve Eisner
+2  A: 

Sharepoint: Best way to display lists of non-Sharepoint content with “compatible” UI?

Take a look at the built in sharepoint web controls:

Microsoft.SharePoint.WebControls Namespace

It contains all the controls used in sharepoint. I'd tell you more, but the documentation is very thorough.

Mashed Potato
A: 

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.

LeonZandman
A: 

The most compatible gui of a SharePoint list is a ... SharePoint list ;-)

So connect the WSS 3.0 / SharePoint 2007 list directly to your external data with background update using a 3rd party tool. Nothing to program with this, the data is in the list within minutes. And you have really ALL list features, grouping...and workflow - if external data changes.

http://www.layer2.de/en/products/Pages/SharePoint-Business-Data-List-Connector.aspx

Possibly the most easy way.

SharePointFrank