WPF Datagrid and EF entities - only one row in detail can have a checked property
-
I have created this with Entity Framework 5 using a database first approach, and have an MVVM structure in place. Things are working so far, but not all requirements have been met. Fairly simple situation - master 'contact' entity and child collections of entities, phone numbers and emails. SelectedContact is the master property in the view model, and as it changes, the related phone numbers and emails are retrieved from the database where they populate ObservableCollections of phones and emails in the view model. The datagrids are bound to the ObservableCollections. Only one of each child collection can should be set as the primary phone number or primary email. The Primary property of each phone and each email is represented in the datagrid with a checkbox column. Right now users can freely set many/all of each phone collection and email collection as the primary, and that runs contrary to the requirement. So what would you recommend as the optimal approach here? What I'd *like* to have happen is that, as a user checks one row as primary, all the other rows are unchecked. Any ideas?