0
votes

I'm learning how to develop webparts in SharePoint 2010.

What I'm having difficulty finding is how to allow the user to change the DataSource of the WebPart in the UI. I want to allow them to pick a list from the site, preferably of a specific type but one thing at a time.

Is there a specific control to do this or are you just supposed to expose a property of the webpart so the user can alter it?

There must be information on this out there but I'm having trouble finding it. Does anybody have any good links on this subject?

2

2 Answers

0
votes

Craig,

Using Web Part Property you can change DataSource from Edit mode and save it.

For custom webpart property click here.

Let me know if u have any query.

0
votes

It sounds like it is the Content Query Web Part you are looking for.

This sounds like a great place to start reading: "How to: Customize the SharePoint Content By Query Web Part by Using Custom Properties (ECM)": http://msdn.microsoft.com/en-us/library/aa981241.aspx

Good luck!