views:

20

answers:

1

I've got two groups in my datagrid. First one is the main group and the second is the subgroup, what I want to do is hide the Main group and just show the subgroups in my data grid. Here is the code:

ListCollectionView collection = new ListCollectionView(bdata);
collection.GroupDescriptions.Add(new PropertyGroupDescription("tid"));// I want to hide this group but not remove it
collection.GroupDescriptions.Add(new PropertyGroupDescription("PkgName"));// Just show Items Based on this group
dataGrid1.ItemsSource = collection;

Any help would be great.

Thanks

Salman

A: 

ListCollectionView supports filtering so all you need to do is filter out the items you don't want to show.

http://bea.stollnitz.com/blog/?p=31

Wallstreet Programmer