* You are viewing the archive for August, 2010

Update postings on Datagrid

Recently I wrote two posts on the Silverlight Datagrid:

Andy noticed that in a comment that the synchronizing of the group row headers with the column headers did not work correctly when the group headers were scrolled out of view and then back into view again.

After investigating the reason of this behavior I have decided to take another approach and to re-implement this functionality. Some additional testing of this new implementation reveals that the issue reported by Andy has been solved. The only quirk … Continue Reading

Drag and Drop grouping in Datagrid

Update

The code for the functionality in this post has been updated in Update postings on Datagrid

Introduction

The DataGrid of the Silverlight Toolkit supports grouping but does not have the ability to drag column headers to the area above the grid to group the data, unlike some other 3rd party datagrids.

This blog presents a solution to implement this functionality. The solution is based upon the solution which can be found on the blog Lee’s corner. … Continue Reading

Postponing actions

Introduction

Often modifications to an object (setting properties or calling methods etc.) cause synchronization actions to be executed. For instance, adding a SortDescription to an ICollectionView object can cause the object to perform a sorting operation on the items it contains. When multiple modifications to an object are made, it is desirable to postpone these synchronization actions until all modifications are made.

This blog presents the PostponableAction class with which this kind of behavior can be implemented. This idea is based on and can be used as an implementation to the DeferRefresh method of the ICollectionView interface.

Table of … Continue Reading

Synchronizing group row headers with column headers in Silverlight DataGrid

Update

The code for the functionality in this post has been updated in Update postings on Datagrid

Grouping in the DataGrid in Silverlight is quite easy. What is not so obvious is how to change the caption of the column name on the group row. It turns out that you could use the LoadingRowGroup of the DataGrid:

theGrid.LoadingRowGroup += (s, e) =>
{
e.RowGroupHeader.PropertyName = “A custom caption”;
}

The original value of the e.RowGroupHeader.PropertyName is the PropertyName of the PropertyGroupDescription. Using this value the column header can be determined:

private string GetColumnCaption(DataGrid grid, string columnName)
{
Continue Reading