EditableRootListBase (ERLB) and master/detail DataGridView - no can do

EditableRootListBase (ERLB) and master/detail DataGridView - no can do

Old forum URL: forums.lhotka.net/forums/t/6190.aspx


tiago posted on Sunday, January 18, 2009

I read all there is to read on this forum about this subject and elsewhere. Don't waste your time: it just doesn't work. Your users will have a lot of problems and some nasty error messages (remember you don't have undo nor save options). When you try to fix the problems, there will be even more errors to solve.

Of course I'm talking about automatic data binding. You can get a sorted RootListDGV but it is impossible to get a sorted ChildListDGV.

I gave up and came back to my first solution:

Root DGV
RootCollection - EditableRootList
RootObj - EditableChild

ChildDGV
Root - EditableRoot
ChildCollection - EditableChildList
ChildObj - EditableChild

When the RootDGV changes, a Root object is created with the same ID of the RootObj.

You have save buttons and you can control what is happening. No stupid synchronization problems, no fancy errors. You can undo and you can allow save only when the collection is Valid.

You don't have auto save on row change out of the box. But of course it can be done programmaticaly.

tiago replied on Thursday, March 12, 2009

After a lot of research and hard work, I did it. Go to http://forums.lhotka.net/forums/thread/31781.aspx to find how to do it.

Copyright (c) Marimer LLC