I can now officially say that the DataSet can kiss my lilly white ass! I have just successfully data bound a custom collection that contains objects that have a property containing another collection. All collection classes derive from CollectionBase, and implements IBindingList. The individual objects implement IEditableObject. This also now makes the design pattern I’m using ready for primetime.

I wasn’t sure how I was going to handle DataBinding in WinForms apps w/o a DataSet. Guess what? I can. Anyway, I followed this example at MSDN, Windows Forms Data Binding and Objects. It’s a caugh VB.NET caugh example, but I was able to extrapolate what I needed.

The only thing left was how to setup the DataGrid. I set the DataSource to the parent object collection:

ABADataGrid.DataSource = banks;
ABADataGrid.DataMember = "ABAs";

and the DataMember is the property name on a individual parent object, Bank, that contains the collection of child elements. This wound up working like a charm. The hierarchy is as follows:


Some other resources consulted where:

HOWTO: implement IBindingList in Winforms
HOWTO: implement IListSource in Winforms v2

So, needless to say, I’m quite happy. See ya later DataSet!

[Listening to: andromeda]

So, I came across a tribute site for ASCII porn. Check it out here.

[Listening to: Back In Black – Rock And Roll Ain%27t Noise Poll.mp3 ]

In case you wrote a IConfigurationSectionHandler in .net 1.0, you may have a problem with 1.1. Check
here for the answer.

[Listening to: Back In Black – Rock And Roll Ain%27t Noise Poll.mp3 ]