I'm currently working on a personal project which main goal is to create simple and customizable dashboards for everyday life.
In order to avoid wrong way, I would like to know how to do to bind a XSLTListViewWebpart to a custom datasource such as xml stream or IEnumerable of business objects.

thank you for any help, Regards, Laurent MONDEIL

1 Answer 1


There are plenty of choices when it comes to bringing business data into SharePoint.

1. Business Connectivity Services

This is recommended and the most legal way. Just create a web service and attach an external content type to it. Also you can use direct connection to a database.

You can find a comprehensive article about BCS in MSDN Magazine:

2. Custom DataSource for an Xslt WebPart

XsltListViewWebPart is basically impracticable choice here: this webpart handles it's datasource internally, and it is sealed. Binding it to a custom datasource is impossible.

DataViewWebPart is much better, but after some reflector explorations and few tries, I've found out that it accepts only a limited set of datasource types, and although binding your own datasource seems to be legal, in fact it will cause exception in runtime.

Fortunately, there are plenty XSLT webparts in SharePoint, and DataFormWebPart accepts custom datasources perfectly. I've tested it, and it works with minor changes to the XSLT code.

Using DataFormWebPart is very simple. Open SharePoint Designer, open a webpart page in SPD editor, and then you can use "Insert" ribbon tab to add a data view to the page. You can use an XML file containing your sample business data as a datasource to make SPD generate proper XSL code.

After you configure the webpart with static sample datasource, you can safely replace SPXmlDataSource with your custom datasource control.

It will look and feel almost like XsltListViewWebPart, but AFAIK you can't integrate it with ribbon, and there are some other inconveniences.


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.