Cross Tables in Windows Forms - Data Binding Magic

I have this sample from a recent talk at Basta! conference in Germany, which shows (among other things) how to bind a cross table to a DataGridView (the standard .NET 2 data grid). A cross table is basically the result of transposing some data and using one of the fields for a second dimension.

The sample I have works on two tables of data. It doesn’t actually use a database and the reference that points from the list of votes to that of features is implemented as an object reference, but the relationship is like this:

Now, let’s assume there’s this data in the two tables/lists:

Features

IDName
1Synthesize out-of-the-box supply-chains
2Syndicate vertical mindshare

Votes

IDFeature_IDYearPriority
11200430
21200540
31200670
42200470
52200560
62200630

In a cross table the same data could look like this:

Feature/Year200420052006
Synthesize out-of-the-box supply-chains304070
Syndicate vertical mindshare706030

This is exactly the kind of transformation demonstrated in my sample. Now, there are a number of other things in that program, so don’t be confused. I suggest you focus on the workings of the VoteValuePropertyDescriptor class.

Here’s the download: FeatureVoting.zip

Sorry, this blog does not support comments.

I used various blog hosting services since this blog was established in 2005, but unfortunately they turned out to be unreliable in the long term and comment threads were lost in unavoidable transitions. At this time I don't want to enable third-party services for comments since it has become obvious in recent years that these providers invariably monetize information about their visitors and users.

Please use the links in the page footer to get in touch with me. I'm available for conversations on Keybase, Matrix, Mastodon or Twitter, as well as via email.