DataGridコントロールの行のグルーピングの方法を紹介します。 PagedCollectionView と GroupDescription クラスを利用して、サマリー行の作成 using System.Windows.Data; using System.ComponentModel; List<Person> listData = < ... >; PagedCollectionView collectionViewSource = new PagedCollectionView(listData); SortDescription sortDescription = new SortDescription("Age", ListSortDirection.Ascending); collectionViewSource.SortDescriptions.Add(sortDescription); GroupDescription groupDescription = new PropertyGroupDescription("ID"); collectionViewSource.GroupDescriptions.Add(groupDescription); dataGrid1.ItemsSource = collectionViewSource; public class Person { public int ID { get; set; } public string Name { get; set; } public int Age { get; set; } } ★月額105円~/容量最大30GB/機能満載! ロリポップ!レンタルサーバー ★ コメント: |