In certain contexts I have always found it useful to bind to a sequence of numbers, or sometimes even just a dummy collection with a certain number of elements. It’s like a for-loop, just for data binding. I’ve found three good ways of doing that in XAML, as the following two source code snippets show:
<Window x:Class="WPFSequenceBinding.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr- ...
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 …
I don’t think I’ve blogged about this yet, other than the original announcement about the event — turns out I’m going to speak at the event as well. They haven’t published their complete agenda yet, but there’s an overview of (some of?) the sessions available, including mine. This is what my session’s going to be:
Dynamic Languages and .NET
Last year Microsoft announced their future plans for dynamic language support in the .NET CLR, and existing projects like IronPython and PowerSh …
BASTA! was a good conference with a lot of great sessions. I did two myself — advanced functionality in the DataGridView (with some non-DataGridView specific things, like a cross table implementation based on ITypedList) and a session on ORM in real-world applications, going into some scenarios that come up when the typical SQL/ADO.NET based application architecture is converted towards ORM.
For Developer Express, we also had a great time in the exhibition, where we did lots of demos and had …
I’ll be in Frankfurt, Germany next week for BASTA!. I’m doing two sessions there and exhibiting for Developer Express. I’m looking forward to seeing you there, and please feel free to email me if you want to meet up outside the event.
In part 1 of this post, I explained the purpose of those wrapper classes I created, and why the structure is how it is. I’m making the source code of the library available with this post — use it as you see fit, but please note that I have done no production testing of this code, so don’t blame me if it breaks. The download is here: Sturm.CollectionWrapping.zip
Now how do you use that thing? Basically you use code like this:
Binding ...
Most of you are probably familiar with the ITypedList
interface. This old post of mine shows a potential use case, and there are lots of other reasons to make use of this powerful way of influencing the mechanics of .NET data binding. Implementing the interface is easy enough, but an interface implementation is really rather an inconvenient way of attaching a set of property descriptors to a collection — so it regularly happens that we have a collection instance at some point in our code, an …
You thought DeveloperDeveloperDeveloper day was the least easily pronouncable name for a community event? Well, try this on: NxtGenUG is organizing NxtGenUG — Fest07 (actually I have the suspicion that it’s harder to type than to pronounce after all)! It’s a community event, I guess, being organized by a user group, but then it’s not the same type of free event we’ve seen in the past. As a non-member of NxtGenUG it costs money to attend — I’ll be interested to see whether that works out for t …