tags:

views:

14

answers:

1

If I bind a datagrid and a dataform to the same ItemsSource I assumed that as I select different rows in the datagrid, the selected item would be displayed in the dataform.

It appears this only true if the data source is a PagedCollectionView and not an ObservableCollection? Is that correct?

+2  A: 

ICollectionView exposes members to handle a selected item and for moving between items. An ObservableCollection is just a generic list with the added ability to throw an event on change. The DataGrid relies on the SelectedItem functionality of a ICollectionView to know what the DataGrid has selected.

Note that the DataGrid always uses an ICollectionView to represent its Items. If you provided an ICollectionView as the ItemsSource it will use that object but if you provide any other IEnumerable it will wrap it in its own internal ICollectionView

Stephan
+1: The internal `ICollectionView` is a `PagedCollectionView`
AnthonyWJones