SPREAD for WPF 3.0J - GcSpreadGrid
AggregationType プロパティ
使用例 

GrapeCity.Windows.SpreadGrid 名前空間 > GroupCell クラス : AggregationType プロパティ
このグループセルの集計タイプを取得または設定します。
シンタックス
'宣言
 
Public Property AggregationType As AggregationType
public AggregationType AggregationType {get; set;}

プロパティ値

このグループセルの集計タイプを決定する AggregationType 列挙体の値。
解説
AggregationType を変更すると、Formula プロパティの値は自動的に空に設定されます。
使用例
次のサンプルはGcSpreadGridがデータをグループ化し、AggregationType を使って各グループ数を表示します。
List<Customer> list = new List<Customer>();
list.Add(new Customer() { Name = "Nancy", Country = "Japan", City = "Tokyo" });
list.Add(new Customer() { Name = "Janet", Country = "Japan", City = "Sendai", });
list.Add(new Customer() { Name = "Rose", Country = "Japan", City = "Tokyo", });
list.Add(new Customer() { Name = "Buchanan", Country = "Japan", City = "Osaka", });
list.Add(new Customer() { Name = "Leverling", Country = "Japan", City = "Tokyo", });
list.Add(new Customer() { Name = "Gavin", Country = "China", City = "Beijing", });
list.Add(new Customer() { Name = "Victoria", Country = "China", City = "Xi'An", });
list.Add(new Customer() { Name = "Apple", Country = "China", City = "Beijing", });
list.Add(new Customer() { Name = "Tim", Country = "China", City = "Beijing", });
list.Add(new Customer() { Name = "John", Country = "China", City = "Xi'An", });

gcSpreadGrid1.ItemsSource = list;

Column column1 = gcSpreadGrid1.Columns["Country"];
GroupCell headerCell = column1.GroupHeader[0, 0];
headerCell.ColumnSpan = int.MaxValue;
headerCell.Background = Brushes.Azure;
headerCell.Formula = @"GroupInfo(""groupBy"") & "": "" & GROUPINFO(""groupText"")";

column1.GroupFooter.RowCount = 1;
column1.GroupFooter.Rows[0].Background = Brushes.LightBlue;
GroupCell footerCell1 = column1.GroupFooter[0, 0];
footerCell1.Value = "Count: ";
footerCell1.ColumnSpan = gcSpreadGrid1.ColumnCount - 1;
GroupCell footerCell2 = column1.GroupFooter[0, gcSpreadGrid1.ColumnCount - 1];
footerCell2.AggregationType = AggregationType.Count;

SpreadGroupDescription groupDescription = new SpreadGroupDescription();
groupDescription.ColumnName = "Country";
gcSpreadGrid1.GroupDescriptions.Add(groupDescription);
Dim list As New List(Of Customer)()
list.Add(New Customer() With { _
.Name = "Nancy", _
.Country = "Japan", _
.City = "Tokyo" _
})
list.Add(New Customer() With { _
.Name = "Janet", _
.Country = "Japan", _
.City = "Sendai" _
})
list.Add(New Customer() With { _
.Name = "Rose", _
.Country = "Japan", _
.City = "Tokyo" _
})
list.Add(New Customer() With { _
.Name = "Buchanan", _
.Country = "Japan", _
.City = "Osaka" _
})
list.Add(New Customer() With { _
.Name = "Leverling", _
.Country = "Japan", _
.City = "Tokyo" _
})
list.Add(New Customer() With { _
.Name = "Gavin", _
.Country = "China", _
.City = "Beijing" _
})
list.Add(New Customer() With { _
.Name = "Victoria", _
.Country = "China", _
.City = "Xi'An" _
})
list.Add(New Customer() With { _
.Name = "Apple", _
.Country = "China", _
.City = "Beijing" _
})
list.Add(New Customer() With { _
.Name = "Tim", _
.Country = "China", _
.City = "Beijing" _
})
list.Add(New Customer() With { _
.Name = "John", _
.Country = "China", _
.City = "Xi'An" _
})

gcSpreadGrid1.ItemsSource = list

Dim column1 As Column = gcSpreadGrid1.Columns("Country")
Dim headerCell As GroupCell = column1.GroupHeader(0, 0)
headerCell.ColumnSpan = Integer.MaxValue
headerCell.Background = Brushes.Azure
headerCell.Formula = "GroupInfo(""groupBy"") & "": "" & GROUPINFO(""groupText"")"

column1.GroupFooter.RowCount = 1
column1.GroupFooter.Rows(0).Background = Brushes.LightBlue
Dim footerCell1 As GroupCell = column1.GroupFooter(0, 0)
footerCell1.Value = "Count: "
footerCell1.ColumnSpan = gcSpreadGrid1.ColumnCount - 1
Dim footerCell2 As GroupCell = column1.GroupFooter(0, gcSpreadGrid1.ColumnCount - 1)
footerCell2.AggregationType = AggregationType.Count

Dim groupDescription As New SpreadGroupDescription()
groupDescription.ColumnName = "Country"
gcSpreadGrid1.GroupDescriptions.Add(groupDescription)
参照

GroupCell クラス
GroupCell メンバ