WPF DataGrid 分组

public  ListCollectionView collection;
collection = new ListCollectionView(obj.empData);

collection.GroupDescriptions.Add(new PropertyGroupDescription("Country"));
dgData.Items.SortDescriptions.Add
          (new System.ComponentModel.SortDescription
                   ("Country"
                    ,System.ComponentModel.ListSortDirection.Descending
                   )
           );
原文地址:https://www.cnblogs.com/babietongtianta/p/3457296.html