Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. WPF Datagrid and EF entities - only one row in detail can have a checked property

WPF Datagrid and EF entities - only one row in detail can have a checked property

Scheduled Pinned Locked Moved WPF
wpfcsharpdatabasebusinessarchitecture
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Duke Carey
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups