By default, the
DataGrid will generate columns for us based on the type of objects that we pass to the control. We looked at this in the Displaying the data in a customized DataGrid recipe. However, we'll want more control over what is being displayed most of the time. We'll want to make decisions such as which columns should be shown, in what order and so on. On top of that, we may want to allow the user to select a value from a
ComboBox for a particular column or entirely reformat a value.
In this recipe, we'll take full control over what will be displayed by the
DataGrid by creating a number of columns ourselves.
To follow along with this recipe, you can continue using the code that was created ...