John Lam 1997 — 2026

I'm not smart enough to figure out data binding in Windows Forms

I interrupt the regularly scheduled Ruby lovefest on this blog to rant a little bit.

I’ve been spending a lot of time getting data binding against ActiveRecord to work. Is it just me, or are these the most over-engineered, non-intuitive set of interfaces ever designed?

For example, why is it that the ICancelAddNew.CancelNew method gets called when I abandon editing a field in a DataGridView?

There are a lot of other nasty gotchas like this waiting to pounce on the poor souls who are trying to write custom business entity objects, yet want the users of those business entity objects to experience the goodness of data binding.

Now back to our regularly scheduled Ruby lovefest … :)

3 archived reader comments

John Lam (2006/05/10)

There’s lots of improvements in Windows Forms 2.0 - especially via new interfaces like INotifyPropertyChanged. However, the crappy documentation and hidden gotchas make it much harder to use than it needs to be. To be fair, BindingList<T> does most of the heavy lifting for you. However, BindingList<T> doesn’t let me do what I’m after (I implement IBindingList in the Ruby Array class), which is why I have to feel the pain :)

NoiseEHC (2006/05/10)

My little page is almost the only information about hardcore winforms databinding. It has not been updated to v2.0 but the conclusion is that you should avoid relying on that for complex problems… http://NoiseEHC.fw.hu/ BTW: a week ago I tried to use v2.0 databinging and it seems that it became slightly better but remained as useless as the old one…

Dilip (2006/05/10)

Frans Bouma (google for his blog), the creator of LLBLGenPro ORM product has chronicled his experiences with winforms databinding over the past few years. I think he ran into so many issues that you are probably getting stuck with today. Anyway, just to assure you that you are not alone :-)