Bind a SharePoint list to a Silverlight Dataform - silverlight-4.0

I am using the SharePoint client-object model to read data from a list and I was finally able to correctly get the data but now I am having difficulty actually displaying that data. I would like to use a dataform control to both add and edit the SharePoint list but am thus far unable to get it to actually display the items in the list. If anyone knows how to connect a Dataform control to a sharepoint list I would be very thankful.

You have to bind your list to the control. Have a look at the following page: http://dotnetslackers.com/articles/silverlight/The-DataForm-Control-in-Silverlight-3-Revisited.aspx section "Data binding" explains the steps you need to make (setting the DataContext property).

Related

Data entry form in sharepoint

I was wondering if anyone knows what a simplest way to create a data entry form in Sharepoint 2010 Foundation would be. Basicly I am looking to create a form that will submit its data to a custom list on the site, I don't want the users to interact with the list directly but use the form to enter data instead.
Also I can't use Designer or InfoPath, not being able to use these is what is causing the problem it seems. Just curious if anyone else has done something like this or could point me in the right direction.
Thanks
Every list is born with forms by default - one for item creation, one for edition and one for displaying. If you use content types, then you get a trio of these for each different type.
You never interact with the list directly, you do it through these forms. If you can't use either Infopath nor Sharepoint Designer, you can still edit them by clicking on the Page tab, then the Edit Page button. From there you can add or remove web parts, and connect them among themselves.
However, the amount of control you have is too limited when compared to editing pages through either of the tools or mentioned, or Visual Studio. For example, there is no straightforward way to add or remove list fields based on content type. Be prepared for ever increasing frustration if you can't use those tools.

How can a custom web part read the list item fields in a display/edit form?

I need to create a custom web part and programmatically attach to the display and edit forms of a list. The web part is meant to display some information (coming from another list) about the list item being displayed on the form.
I know how to add the web part to the list programmatically, but I'm having an issue trying to get the web part to read the list item being displayed on from. I know the SPForm object exposes its parent list but I cannot or don't know how to convert the form to an SPForm object. The parent of the web part is the web part manager and the parent of that is the HTML form object. But when I try convert that to an SPForm object it throws an error.
Also, even if I manage to get hold of the SPForm and its parent list, how can I get hold of the list item being displayed?
Please bear in mind that I need to avoid overwriting the default forms as it will significantly increase the development time.
Any help or idea is appreciated.
Regards

Sharepoint WebPart DataSource

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?
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.
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!

ECT External Content Type (using Infopath External Item Picker) with List

I would like to create a list with some External Data fields (and other fields) and customize it in Infopath, but it's not working.. InfoPath says:
The following fields in the SharepPoint list are not supported because
of their data type and will not be available in InfoPath Designer:
-field_1 (BusinessData)
-field_2 (BusinessData)
Is it possible to use an External Content Type (WCF Service) with a list in Infopath?
I mean, use an External Item Picker in a Infopath form that connects to a list. Or is it only possible with a Form Library?
Any ideas on how to solve this or a suggestion to another approach?
Thanks in advance.
It is possible to create the scenario you're referring to... if I understand you correctly, you want to use the External Item Picker to create a pick list within an external list against another list.
You would have to associate the two external lists (ECTs) within your BCS model. This association must be a foreign key based association. That done, SharePoint will automatically create an External Item Picker in the default list form.
I'm currently doing the same thing and it works for me in Sharepoint. However, when I modify the form in Infopath, I start to get errors whenever I select an item in the External Item Picker. As long as I don't use InfoPath to modify the form, it works fine in SharePoint.
I hope this answers your question.
Cheers!

how to fill combo box in silverlight from database

i have a silverlight application.In this i have used service file for DML operations.The methods in Service can be accesed in form page.ie the the XAML page(example Main.XAML)
MY issue is i cant access my DB in the XAML pages as it is in silverlight,i want to create a method in Service file,get some data from MAster tables and fill it in the combo boxes which are there in my first form.
Im trying to use System.Windows.Forms.ComboBox combobox as a control as i cant access the controls of my forms in the service file and then trying to use this control in my form(Main.xaml)then it is showing an error.
Can anyone please let me know how can i populate data this way in combo box.
Rply as early as posible.
You'll need to add an operation to your service that returns a collection of data contracts (for instance a collection of products).
Then call the service from your SL application using an asynchronous call and bind the data to the combo box in the async callback.
There's a working example here.