I have successfully created my data source, which is a CLR object of the class Person. Person class has a bunch of public properties, such as Name, Emails, Phones, etc. I want to data bind person's emails (there's more than one email) to DataGrid or ListBox controls.
I want to be able to choose which fields of the email I want to show (email has properties ID, email, and email type). If I just data bind ItemsSource property:
How can I make it right using Microsoft Expression Blend? I have the latest version 4 if it matters to anyone. Thanks very much!
Click on the little box to the right of the ItemsSource property for the DataGrid or ListBox in Blend and choose "Data Binding..."
If Blend can figure out the data type that your are using as a DataContext, then you can select your collection from the "Data Context" tab. If Blend doesn't know, then you choose "Use a custom path expression" and type in the name of the property to bind to.
Hope this helps, B