Understanding the DataGrid and the ObservableCollection
In most cases you perform data-binding operations against .NET collections, even when fetching data from databases. WPF offers a different binding mechanism, such as user controls like the new
ListView, or the
ListBox; you can bind specific data to single controls like
TextBox (for example, when building master-details representations). In this book, you get an example of how to take advantage of the
DataGrid control, which offers a convenient and fast way for tabular data. The goal of the next example is binding a collection of objects to a
DataGrid enabling you to insert/update/delete operations onto the collection. First, add a new implementation of the
Person class to the ...