Displaying spatial data in WPF: from SqlGeometry to PathGeometry 26 December 2009 Diederik-Krols WPF, SQL Server This article explains how to visualize spatial data (e.g. from SQL Server 2008) in Windows Presentation Foundation without using 3rd party components or proprietary formats. We'll build a little form that allows us to enter test data in the Well-Known Text format (WKT) - manually or via copy/paste, ... [More]
SQL Spatial Tools: Map Projections 25 December 2009 Diederik-Krols SQL Server, WPF SQL Server Spatial Tools on CodePlex contains useful extra functions for the SqlGeometry and SqlGeography data types, as well as a new data type for affine transformations (to scale, translate, and rotate) and a handful of Map Projections. This article describes how to use these projections and visu... [More]
An Office WPF Ribbon Control Walkthrough 29 November 2009 Diederik-Krols WPF The Microsoft WPF Ribbon control is a free control that brings the Office 2007 Ribbon features to your WPF applications. To get your hands on it, just follow the instructions on CodePlex. This article walks through the Ribbon features. I simply built "NotePad with a Ribbon". Here's how it looks like... [More]
Charting with WPF and Silverlight 19 October 2009 Diederik-Krols WPF Sometimes we need to decorate our WPF or Silverlight applications with things like bar charts or pie charts. There's no need to create these from scratch, since a lot of charting solutions are available, some of which are free while other are ... less free. On CodePlex you find the Silverlight Toolk... [More]
Validation in a WPF DataGrid 30 September 2009 Diederik-Krols WPF In this article I will describe two options to implement validation on the cells and rows of a WPF DataGrid. On the architectural level you have indeed (at least) two options when it comes to validation. You can decide to validate through independent reusable logic captured in ValidationRules, or yo... [More]
A minimalistic template for an editable WPF DataGrid 30 September 2009 Diederik-Krols WPF By default, a WPF DataGrid operates in its birthday suit, with no decorations at all. For your end user this is not intuitive, so you should provide some fig-leafs here and there. In my humble opinion, at least two rows should be easily identifiable in any editable grid: the 'new' row (gener... [More]
Workaround: WPF DataGrid hangs Visual Studio.NET 29 September 2009 Diederik-Krols WPF Welcome to a WPF DataGrid crash course ... literally. It will show you how Cider can give you a hangover. It took me 45 minutes, 10 process kills, and a full reboot to figure out what was going on in my application, so I gladly share my experience. Part one: the bug Create a WPF Form w... [More]
Inserting, Updating, and Deleting from a WPF DataGrid 29 September 2009 Diederik-Krols WPF You already know how easy it is to implement databinding in the WPF DataGrid from a previous article. Let's dive just a little bit deeper, and decorate this application with the code to trigger insert-, update- and delete-calls against the underlying Model and/or Data Access Layer. I'll stick t... [More]
Codeless two-way data binding to a WPF DataGrid 26 September 2009 Diederik-Krols WPF WPF 4.0 will finally contain a DataGrid. If you can't wait for that one, then all you have to do is download the current release of the WPF Toolkit. The DataGrid control in this toolkit is considered as stable, so why not give it a test drive? Let's create a list of Formula 1 Drivers and two-w... [More]
In WPF, SelectionChanged does not mean that the selection changed 09 September 2009 Diederik-Krols Windows Presentation Foundation's Routed Events can lead to unexpected or at least nonintuitive behavior when using TabControls that contain ListViews and/or ComboBoxes. A routed event generally bubbles from the control that raised it, up the whole element tree until the root. On its way up it ... [More]