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
?