How do I add additional data to a DataGridRowGroupHeader?

Posted by Jeff Yates on Stack Overflow See other posts from Stack Overflow or by Jeff Yates
Published on 2010-03-22T12:40:44Z Indexed on 2010/03/22 12:51 UTC
Read the original article Hit count: 764

Filed under:
|
|
|

I have a DataGrid that is showing some data via a PagedCollectionView with one group definition. I have created a Style for the corresponding DataGridRowGroupHeader under which I have added a ControlTemplate containing an additional TextBlock and a spacing Rectangle. I would like to bind the widths of these controls to the widths of particular columns, but I am struggling to get this working. I would also like to bind the Text property of the TextBlock to a value.

I tried binding the widths via the Width property of a Rectangle in resources but this didn't work (possibly because the Rectangle was never drawn and therefore didn't calculate it's layout).

However, I believe both sets of bindings can be performed with some use of one or more ValueConverter implementations, but I was wondering if there was a better way. Can any of this be achieved through the definition of a ControlTemplate?

© Stack Overflow or respective owner

Related posts about silverlight-3.0

Related posts about c#