Data Binding in WPF Applications

For the first time, Visual Studio 2010 has support for drag-and-drop data binding with WPF projects. The process is identical to the one we just covered for binding Windows Forms controls; we first need a data source added to our project. To change things up a bit, let’s quickly build out a form that shows purchase orders and their detail line items.

First, create a new WPF project. Refer to Chapter 19 if you want to refresh your knowledge of the WPF project type and its designers/editors. Add the data sources in the same exact fashion as we did previously by using the Data Sources wizard. From the AdventureWorks database, we select both the PurchaseOrderHeader and PurchaseOrderDetail tables to be included in ...

Get Microsoft® Visual Studio® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.