SharePoint creates a list and uses the Windows Presentation Foundation application to manage the list

Source: Internet
Author: User

SharePoint creates a list and uses the Program management list list to be one of the ways that SharePoint developers enter data. Use the Web interface to create a list and add some data, in the following steps: 1. Open the site. 2. Click on all site content. 3. Click Create. 4. Select a custom list, name customers, and enter a description. Check the Quick Launch navigation display and click Create. This will create a custom list. Next we add three columns: Region/size/sales. 1. Click the Ribbon to create a column button, name region, select the "Options" type. Add four options: East/west/north/south. The rest defaults, click OK. 2. Add the size bar, the same "option" Type: small/medium/enterprise, click OK. 3. Add the Sales column, select a single line of text and click OK. 4. Finally, click on the Ribbon list settings, click the title link, change the default title to name, click OK. 5. Although you changed the title to name, you still need to use the title when programming. Place your mouse over the name field and look at the URL's field=title.
6. In order to add some items to the list. Click on the Customers list and click Add New Item. Complete the following results.
You can write programs for lists in SharePoint 2010 that enable you to manage/create/read/update/delete (CRUD) operations. 1. Administrator Open vs 2010. New project WPF Application. 2. Name Wpfsplistapp. Click OK. Right-click the MainWindow.xaml file and select View Designer. 3. Add 5 Labels/4 text boxes/3 buttons.
Here are some of the name properties
5. Right-click Mainwindwow.xaml to view the code. 6. Right-click the reference, click Add Service Reference, click Advanced, and click Add Web Reference 7. In the Add Web Reference dialog box, click the Web Service link for the local computer.
8. Select the Lists service, such as the Http://<server name>/_vti_bin/lists.asmx Web service. You need to change the server name to your own. Provide a name and click Add Reference.
9. You can add event handlers for each button at this point. The Update button is responsible for Web services connecting to SharePoint. You also need a series of class-level variables to get user input and pass to the lists Web service. When you call Lists Web service, you also need to create XML to pass data from WPF to the SharePoint list. XML is called collaborative application Markup Language (CAML). You need to update the MAINWINDOW.XAML code: F5 Debugging. Click Update.
11. View the list.
In this example, you use the lists Web service, which provides many ways to communicate with lists----such as Add/Remove lists/Add attachments/get lists, etc. In this case, you used the Getlistandview method. This call, you pass the list name customers, maps the return value to the XmlNode object. XmlNode Mylistview = Mylistservice.getlistandview ("Customers", "" ");
This example also uses CAML to insert data into the SharePoint list. I have to say that Caml is lengthy and verbose.
The last key UpdateListItems method, passing in the list ID and list schema. XmlNode Mylistreturn = Mylistservice.updatelistitems (Strlistid, batchxml);
This method uses the native Web services, which has advantages and disadvantages. Advantages include ease-of-use and research on existing services, otherwise you'll need to create them yourself; Disadvantages include potential service integration performance and the lengthy complexities of CAML syntax.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.