views:

18

answers:

1

I'm using the Silverlight Toolkit DataGrid. Grouping is working fine, thanks to the PagedCollectionView class.

My question is, is there an easy way to customize the text of the group header? When I group by "CurrentBook.SubTitle" (just testing it out - grouping by a book's subtitle doesn't actually make sense) it displays "CurrentBook.SubTitle" in the group header of the grid, when I'd prefer just SubTitle.

Obviously I could just make a new property in my ViewModel called SubTitle that passes along CurrentBook.SubTitle, but I'm just wondering if there is any built-in way to affect the group header text.

+1  A: 

Its a little difficult to answer this without seeing an example of your code. Follow the advice here and make a style for the DataGridRowGroupHeader with something like PropertyName="{Binding Collection Path=Name}" and add that style to the RowGroupHeaderStyles Property. Im not sure how much more specific I can get without seeing more though.

stocherilac