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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Child list for field xxx cannot be created when using BindingContext.EndCurrrentEdit

Child list for field xxx cannot be created when using BindingContext.EndCurrrentEdit

Scheduled Pinned Locked Moved C#
help
2 Posts 2 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.
  • N Offline
    N Offline
    Nigel Mackay
    wrote on last edited by
    #1

    My project is large, so I can't remember when I last made any changes to this particular form, which used to work. To bind the my datasets to the datagridviews I have:

    bsUsers.DataSource = dsUsers;
    bsUsers.DataMember = "UserList";
    dgvUsers.DataSource = bsUsers;
    bsRoles.DataSource = dsRoles;
    bsRoles.DataMember = "RolesList";
    dgvRoles.DataSource = bsRoles;

    The grids display the correct data. At the start of saving changes I have:

    Validate();
    BindingContext[dsRoles, "RolesList"].EndCurrentEdit();
    BindingContext[dsUsers, "UserList"].EndCurrentEdit();

    The last line gives the runtime error "Child list for field UserList cannot be created". The previous line (dsRoles) works. I have copied and pasted "UserList" just to make sure that there are no invisible spelling mistakes. In the Watch pane I can't find any property for dsUsers where one can check if "UserList" is still correct.

    L 1 Reply Last reply
    0
    • N Nigel Mackay

      My project is large, so I can't remember when I last made any changes to this particular form, which used to work. To bind the my datasets to the datagridviews I have:

      bsUsers.DataSource = dsUsers;
      bsUsers.DataMember = "UserList";
      dgvUsers.DataSource = bsUsers;
      bsRoles.DataSource = dsRoles;
      bsRoles.DataMember = "RolesList";
      dgvRoles.DataSource = bsRoles;

      The grids display the correct data. At the start of saving changes I have:

      Validate();
      BindingContext[dsRoles, "RolesList"].EndCurrentEdit();
      BindingContext[dsUsers, "UserList"].EndCurrentEdit();

      The last line gives the runtime error "Child list for field UserList cannot be created". The previous line (dsRoles) works. I have copied and pasted "UserList" just to make sure that there are no invisible spelling mistakes. In the Watch pane I can't find any property for dsUsers where one can check if "UserList" is still correct.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Are you trying to reinitialize your grids bindings few times?

      Life is a stage and we are all actors!

      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