5 More Random Gotchas with the WPF DataGrid

1.       DataGridColumn.SortDirection does not actually sort the column.  DataGridColumn.SortDirection is used to queue the visual arrow in the DataGridColumnHeader to point up, down, or to not show.  To actually sort the columns other than clicking on the DataGridColumnHeader, you can set the DataGrid.Items.SortDescriptions programmatically.  Here is an example of an ICommand used to trigger grouping…

17

Launching a custom Dialog to edit items in a DataGrid (with MVVM)

Launching a custom dialog for editing on the DataGrid is another somewhat common request that I see from the discussion list.  I thought I would provide a sample but at the same time implement it with the MVVM pattern.  The requirement that I will use on the sample is that the editing mechanism can only…

19

5 Random Gotchas with the WPF DataGrid

Since the release of the WPF DataGrid there have been several common patterns of questions that developers were asking on the discussion list.  I thought that I would capture some of that here so it would be easy to find.  I’ll also try to keep it as short as possible and refer to other links for more information. …

8

WPFToolkit March 2009 Release and new WPF Themes!

An updated version of the WPFToolkit has been released today.  This includes some high pri bug fixes which are briefly described in the downloads tab.  As a reminder, if you have any questions or find any issues please use the Discussion list and the Issue Tracker.  Enjoy! Also, a new set of WPF Themes has also been released…

1

Exploring MVVM: Grouping with the DataGrid

Model-View-ViewModel (MVVM) is one of those really interesting design patterns that are used in WPF.  It provides a separation between the UI and business logic and uses data binding techniques to connect them together.  Karl Shifflett has some great material on MVVM that you can read about here. Anyway, I thought I’d dig into some…

9

WPF DataGrid Sample: Locking input to the row being edited

Scenario By default the WPF DataGrid will commit a row when focus is lost on the row, the ‘Enter’ key is pressed, tabbing to the next row, or programmatically calling commit on the row.  Let’s say I want to control how the user commits a row edit by locking input to just that row being…

5

WPF DataGrid – Dynamically updating DataGridComboBoxColumn

The Scenario I want to do a master detail like scenario where the selection in one ComboBox cell will update the list of items in the next ComboBox cell and so on.   Setting up the DataSource and ViewModel I will use the Northwind database for this example and will use the first column to…

11

WPF TestApi and DataGrid Sample

Our WPF Test team has just released a library of tools that can be leveraged to test WPF applications.  What’s really cool is that these are utilities that we use internally and now we can push them out to external customers for feedback and usage.  The library currently lives here on codeplex, http://www.codeplex.com/TestApi.  There are…

1

WPF DataGrid Design-time Walkthrough

The DataGrid walkthrough on windowsclient.net/wpf and the Tips & Tricks section on codeplex talk briefly about the Design-time support for DataGrid.  I thought I’d expand on that just a little more so you get a good idea of what you have available.  Installation So to get it to work you need to install the toolkit…

16

WPF DataGrid – New Item Template Sample

This sample shows how to create a template for the NewItemPlaceholder to indicate that you can add a new item.  This is what it will look like: First I will need to create a new template specifically for the NewItemPlaceholder row.  I’ve followed the general outline of the original DataGridRow control template but I’ve only…

26