Scott Logic

Binding a Silverlight DataGrid to dynamic data Part 2 – editable data and INotifyPropertyChanged

April 22nd, 2009
In my previous blog post I described a method for solving the commonly faced problem of binding a Silverlight DataGrid to dynamic data, the form of which is not know at compile time. This blog post extends on the method previously described, adding change notification, allowing the DataGrid to synchronise the UI with changes to [...]

Binding a Silverlight DataGrid to dynamic data via IDictionary

April 17th, 2009
This post demonstrates a technique for binding a Silverlight DataGrid to dynamic data, the structure of which is not know at compile-time … Update: I have extended this technique to add include change notification so that the DataGrid can be made editable. Read all about it in part two. With Silverlight binding data to a DataGrid [...]

Styling hard-to-reach elements in control templates with attached behaviours

February 10th, 2009
OK, the title of this blog post is not very snappy, but it is not an easy problem to describe in a few short words. Here’s the rub, the WPF DataGrid has a select-all button located in the top-left corner, just like Excel and many other grid controls / applications. However, with the default style, [...]

WPF DataGrid – Committing changes cell-by-cell

January 21st, 2009
In my recent codeproject article on the DataGrid I described a number of techniques for handling the updates to DataTables which are bound to the grid. These examples all worked on the assumption that you want to keep your database synchronised with the DataGrid, with changes being committed on a row-by-row basis, i.e. when the [...]

WPF DataGrid – detecting the column, cell and row that has been clicked

December 2nd, 2008
The WPF DataGrid is a very flexible tool, however in its current state certain simple tasks can prove to be rather tricky. A fairly common task when working with DataGrid is detecting which row, or cell a user has clicked on, or whether they clicked a column header. You might expect this information to be [...]

Multiselect DataGrid with CheckBoxes

November 26th, 2008
I am currently very interested in the new WPF DataGrid which was released on codeplex recently. Someone posted an interesting question in the codeplex forums asking about whether it would be possible to configure the DataGrid so that a user can make multiple row selections via checkboxes which are associated with each row. I thought [...]