Note that there are some explanatory texts on larger screens.

plurals
  1. POVB.NET Custom Object Master-Detail Data Binding
    text
    copied!<p>Since beginning to use <a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET" rel="nofollow noreferrer">VB.NET</a> some years ago I have become slowly familiar with using the data binding features of .NET, however I often find my self bewildered by it's behavior and instead of discover the correct way it should work I find some dirty work around to suit my needs and continue on.</p> <p>Needless to say my problems continue to arise.</p> <p>I am using Custom Objects as the Data Sources for by controls and often entire forms. I find it frustrating to separate business logic and the graphical interface. (That could be a new question entirely.) So for a lot of objects I generate a form which has the <code>DataBindingSource</code> for the object. When I create each from using the New Constructor I explicitly pass to it the object to which it should be bound, and then set this passed object as the <code>DataSource</code> of the <code>BindingSource</code>. (That's a mouthful!)</p> <p>Now the Master object (say, bound to each form) often contains a List of objects which I like to have displayed in a <code>DataGridView</code>. I (sometimes) create and modify these child objects in their own form (again creating a databind the same way as the master form) but when I add them to the List in the master object the <code>DataGridView</code> won't update with the new items.</p> <p>So my question really has a few layers:</p> <ol> <li><p>How can I easily/efficiently/correctly update this <code>DataGridView</code> with the list of Detail objects when I add them to the list of the Master object.</p></li> <li><p>Is this approach to <code>DataBinding</code> good/viable.</p></li> <li><p>What's the best way to separate business logic from graphical interface.</p></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload