Video: Binding to Objects
This is the second episode in my short series of screencasts, Binding Patterns. In this episode I demonstrate data binding to objects.
I’ve split this one up into two parts:
Part I:
- Binding to single objects
- BindingSource
- INotifyPropertyChanged
- IDataErrorInfo
Part 2:
- Binding to collections of objects
- IBindingList, BindingList, INotifyCollectionChanged and ObservableCollection
- IEditableObject
- ICustomTypeDescriptor
Download:
- Video - Part 1: Binding Patterns 0×0002 - Binding to Objects - Part 1.wmv (47.5 MB)
- Video - Part 2: Binding Patterns 0×0002 - Binding to Objects - Part 2.wmv (44.1 MB)
- Code and slide deck: Binding Patterns 0×0002 - Binding to Objects.zip (2.49 MB)
Links from the show:
- Interfaces related to data binding:
http://msdn2.microsoft.com/en-us/library/41e17s4b(vs.80).aspx - An important behaviour you should probably know about if you work with data binding:
http://www.lhotka.net/weblog/WindowsFormsDataBindingIssueInVS2005.aspx - A better way to implement IDataErrorInfo:
http://www.codeproject.com/csharp/DelegateBusinessObjects.asp?df=100&forumid=308172&exp=0&select=1800760 - Creating custom ErrorProviders:
http://www.codeproject.com/useritems/customerrorproviders.asp
Again, this one went longer than I thought so I ended up splitting it into two parts (each part is about 40 minutes) to make it more digestable. My video editing skills suck, so you’ll probably be able to tell the “tape” where I sliced the video in two
Now that we have the basics of data binding out of the way, here’s a list of future shows that I’m really excited about doing:
- The Implicit Model-View-Controller with Data Binding
- Advanced objects and audit logs: ChangeCoordinator<T>
- Concurrency with DataSets
Let me know which one gets your blood pumping in anticipation the most!
Suggestions? Feedback? Bugs? Email me at paul@paulstovell.net.
Filed under: Binding

Blood pumping with aniticpation? Hmmmm, let me think… probably which ever one that stars Pamela Anderson and Cameron Diaz.
What’s with the camel?
Very cool, Paul. The series is really taking shape.
I haven’t watched part two yet, but you might also want to touch on the “CausesValidation” property of controls. That’s a great way of, say, allowing the user to hit the “Cancel” button without triggering validation and thus preventing focus change.
Part two sounds like it’ll be very interesting, and subsequent episodes even moreso.
Try this to get your recording size down.
http://joeon.net/archive/2007/03/01/Recording-HowDoI-Videos.aspx
5fps reduces the amount of screen capture.
Really enjoyed these screencasts and would love to see more!
Again, I enjoyed both of your presentations. Keep up the good work.
Your explanation of data binding is straight forward and very easy to grasp … in my opinion the best I’ve encountered. In this presentation you briefly mention a “validation pipeline” and the chain of responsibility pattern. I’d be very interested in what you have to say about this topic, since it is very rare that property validation is as simple as “value must be between x and y”. For instance, we often need to validate uniqueness of a property value across a collection of objects.
[…] ich auf die entsprechenden MSDN-Artikel oder den Screencast von Paul Stovell in seinem Blog-Post Binding Patterns 0×0002 - Binding to Objects (englisch) mit dem geilen Kamel. Das Video habe ich mir an einem gemütlichen Sonntag Morgen bei […]
I noticed some weird datagridview behaviour. I’ve got a list of customers bound to a datagridview and although the data cannot be changed within the grid, it still starts BeginEdit and EndEnd whenever I click a row or move around using the good old cursorkeys. This causes unnecessary cloning of my businessobject each and every time.
Any known remedies to fix this?