Microsoft's 99% rule, part 2
Here's another example a Microsoft "what were they thinking" decision. When I first started looking at the generic databinding architect in the control framework, I thought "wow, this plus web services could be a pretty killer combo". Web services can return collections of "objects", and the controls can bind directly to them - what could be easier? That would make snapping together simple web (or win) applications a piece of cake.
Bzzt. Sorry, wrong, thank you for playing. The proxies generated by WSDL.EXE expose their information as fields, and the databinding stuff only looks at properties. Totally incompatible. What's up with that? Is it an example of the left hand not knowing what the right is doing? Or maybe Microsoft is still too wrapped up in the DataSet world (generally DataSets are pretty crappy for web services). I don't know, but it was a seriously lame decision.
Now, it turns out that there is a partial workaround. Some of the controls (the grids, in particular) will look for an interface called ICustomTypeDescriptor during databinding. If it's implemented, it will use the methods of that interface to retrieve the property information for the object rather than using reflection directly. I was able to put together a generic adapter class that reads a class' fields and exposes them as properties through ICustomTypeDescriptor, and it worked. But not all of the controls use that interface (I've found that the combobox definitely doesn't). So it's a partial solution, and one that shouldn't be necessary. It's not fixed in the framework 1.1, but I'll hold out hope for 2.0.