Tuesday, January 10, 2006

Fie on Data Binding

Data binding sounds so useful when you read about it at a high level, but the details are not up to the promises. Here is a very short, succinct example:



  1. Prepare your data source as a BindingList(Of type) or a DataTable.

  2. Drag and drop a tool strip onto a form and add a ToolStripComboBox to it to display your data in.

  3. Assign the data source to the DataSource member of the ToolStripComboBox.


There, you're done. Easy, wasn't it?


Well, that's what you would assume you do by reading the high-level documentation (i.e. hype). The fact is, a ToolStripComboBox does not have a DataSource member.

2 Comments:

Anonymous Anonymous said...

That's a very unqualified statement. DataBinding is a very useful feature to reduce complexity.
To solve the mentoned problem: The ToolStripComboBox has a ComboBox- or at least a Control-Property where you can bind your data to.
Nevertheless the ToolStripComboBox is a little bit buggy, so you will see the bound data only if the ComboBox is add to the menu's top level.

7:52 AM  
Blogger Bill Blum said...

Thank you for your comment. Do you know you are the very first, and so far only, person (I assume 'anonymous' is a person) who has commented on my blog? Well, except for one person whom I paid to post a comment, but I am not counting him. Anyway, you are absolutely correct in saying that the statement is unqualified. I might even agree that it is very unqualified. Well, that's what I'm here for, making semi-slanderous statements (look, you lawyers, back off, I said 'semi,' didn't I?) that mostly illustrate my own incompetence and lack of understanding of the libraries.

12:16 AM  

Post a Comment

<< Home