Drag-Drop Data Binding For WPF (by Milind Lele)

One of the improvements in VS2010 (CTP available for download here) is drag and drop data binding for WPF applications. Drag-drop data binding has been available for WinForms since Visual Studio 2005. So those of you that are familiar with that will find the WPF experience quite similar and readily usable. This post briefly outlines the improvements in the VS2010 CTP.

At one end of the binding is, of course the control that you are binding, the target. At the other end is data source. In VS2010 you can add either a DataSet or an Entity Data Model to your WPF application and bind the tables or entities to WPF controls by simply dragging the table or the entity and dropping onto the form.

Entity Data Model designer support was added to Visual Studio 2008 SP1. To add an entity data model to your application click Add New Item on the project menu, then select ADO.NET Entity Data Model.


The EDM wizard is displayed allowing you to specify a connection to your database and select tables that you wish to add to your model.


In VS2010, once an EDM is added to a project it will show up in the data sources window.


This acts as the drag source for your binding. From here there are different ways you can go about establishing bindings to your UI. One is to create the UI control, say a ListBox, from the toolbox, then drag-drop an entity from the data sources window to the listbox. Alternately you could generate the control from the data sources window itself. Select an entity and drop it onto the form. The data sources window allows you to select what control you wish to generate. That control gets generated and bound to the entity.

Comments (9)

  1. One of the improvements in VS2010 (CTP available for download here ) is drag and drop data binding for

  2. VB Feeds says:

    One of the improvements in VS2010 (CTP available for download here ) is drag and drop data binding for

  3. Today I was looking at comments on one of my WPF videos on how to create a Master-Detail form in WPF

  4. Anonymous says:

    If you aren’t playing with the WPF 4.0 Visual Studio 2010 CTP already you should be.. There are some significant features and improvements that are worth a look and as far as time goes, not to far away in the distant future. One of the most exciting features

  5. Parecia que as promessas iniciais com o lançamento do WPF no .NET Framework 3.0, chamado de Avalon durante

  6. Today I posted a new interview on Channel 9 on WPF Improvements in Visual Studio 2010 for Building Business

  7. Visual Studio 2010 Beta is released. Late last year we had released a Community Technology Preview (CTP)

  8. This Monday, we released Beta1 of Visual Studio 2010 and .NET FX 4 to MSDN subscribers . Today it is

Skip to main content