Tuesday, March 31, 2009

Nothing's as it seems

I'd forgotten how hard programming is. When you don't know what you're doing. Which is most of the time.

You need to read an XML file. There are a number of options. This XPath thing looks nice. A couple of hours later and you're scratching your head. Why aren't my XPath queries working. They look reasonable, but no amount of tinkering gets them working. Then you realise that XPath is case-sensitive. Should have known that.

You need to display some stuff on a grid. This guy has a nice article about binding custom object collections. Brilliant. Some other guys talk about sorting and filtering with nominal effort. Even more brilliant. So you build your class and get a collection. But this filtering thing doesn't seem to be working. Back to the tinkering. That case-sensitivity perhaps. Nope. Different data types and operators. Nothing. Back to the drawing board, and more reading. And the more you read, the more you get dismayed. For the filtering to work, you'll have to implement IBindingList and IBindingListView. Sheesh. Nothing is as easy as it seems.