Thanks for reading my question!
I have a problem with customizing a DataGrid RowGroupHeader, the situation is:
I need a way of taking control over a DataGrid RowGroupHeader as I want to display some databound values in it. The values will be generated at runtime so the RowGroupHeaderStyle needs to be generated and added to DataGrid’s RowGroupHeaderStyles property at runtime too (possibly using XamlReader.Load).
Additionally the position of the databound value within the RowGroupHeader should be aligned with a corresponding column from the DataGrid.
I’ve managed to create a working template using this post MS Forum but I had no luck with positioning the databound element, in my case TextBlock, to correctly align with a given DataGrid column.
Any suggestions?
Many thanks
Thanks for reading my question! I have a problem with customizing a DataGrid RowGroupHeader,
Share
This hasn’t been an easy one but after some extensive googling and piecing up other people’s experiences I’ve come up with this that work fine for me
At this point I have some dynamic columns in the grid so I’m adding them just as the Grid.ColumnDefinitions so far but if your datagrid is static then you put the right number of columns.
This is where your cell content comes in, and again I have some dynamic columns so I need to add cells dynamically (no need to do this if your grid is static)
That is it pretty much, yes I agree it’s not a trivial job but it gives you custom style when you need it! Feel free to comment!