DataGridCTPSample Grouping

May 31, 2009 at 4:11 PM

The XAML for the grouping has a 'GroupStyle' with a TextBlock and the Text value is "{Binding Path=Name}".

Where is this Name that it is bound to? I have no property named Name bound to my DataGrid. The grouping as I copied and modified from this example is working as I expected.  If I remove this binding I don't get a heading for the group, if I change it to the property I am grouping by it does not work. Is this some sort of majic cookie that just has to be there?




Jun 3, 2009 at 1:18 PM

It is a little bit magical as the DataContext that the header is bound to is MS.Internal.Data.CollectionViewGroupInternal.  The properties on that class are:

object Name

int ItemCount

ReadOnlyObservableCollection Items