O'Reilly logo

Microsoft Silverlight 5 Data and Services Cookbook by Kevin Dockx, Gill Cleeren

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Binding collections to UI elements

Applies to Silverlight 3, 4 and 5

Often, you'll want to display lists of data in your application, such as a list of shopping items, a list of users, a list of bank accounts, and so on. Such a list typically contains many items of a certain type that have the same properties and need to be displayed in the same fashion.

We can use data binding to easily bind a collection to a Silverlight control (such as a ListBox or DataGrid), and use the same data binding possibilities to define how every item in the collection should be bound. This recipe will show you how to achieve this.

Getting ready

For this recipe, you can find the starter solution in the Chapter02/SilverlightBanking_Binding_Collections_Starter folder ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required