Silverlight 3 DataGrid Grouping

Silverlight 3 DataGrid Grouping

Old forum URL: forums.lhotka.net/forums/t/8772.aspx


CyclingFoodmanPA posted on Tuesday, April 06, 2010

Hi,

Has anyone utilized the Silverlight 3 DataGrid Groping utilizing an object from a ReadOnlyListBase and if so, did you use code or XAML to do it and if you could provide a few lines of code as to how you got it to wourk I would be most appreciative.

Thank you in advance,

CyclingFoodmanPA

skagen00 replied on Tuesday, April 06, 2010

I'm changing my answer as I realized that was probably incorrect.

I came across something from Tim Heuer which you've probably already found too.

So if you've got your datagrid bound to a readonlylistbase, you can't just do something like below? Where "Gender" is whatever property you want to group on? (Honestly I haven't used grouping, but it seems pretty straightforward)

  12:             <data:DataGrid ItemsSource="{Binding}">
  13:                 <data:DataGrid.GroupDescriptions>
  14:                     <cm:PropertyGroupDescription PropertyName="Gender" />
  15:                 </data:DataGrid.GroupDescriptions>
  16:             </data:DataGrid>

Copyright (c) Marimer LLC