protected void WebHierarchicalDataGrid1_InitializeBand(object sender, BandEventArgs e)
{
if (e.Band.Key == "Products")
{
e.Band.Behaviors.CreateBehavior<SummaryRow>();
e.Band.Behaviors.SummaryRow.EnableInheritance = true;
ColumnSummaryInfo unitPriceSummary = new ColumnSummaryInfo();
unitPriceSummary.ColumnKey = "UnitPrice";
unitPriceSummary.Summaries.Add(SummaryType.Average);
e.Band.Behaviors.SummaryRow.ColumnSummaries.Add(unitPriceSummary);
this.WebHierarchicalDataGrid1.RefreshBehaviors();
}
else if (e.Band.Key == "Orders")
{
e.Band.Behaviors.CreateBehavior<SummaryRow>();
e.Band.Behaviors.SummaryRow.EnableInheritance = true;
ColumnSummaryInfo quantitySummary = new ColumnSummaryInfo();
quantitySummary.ColumnKey = "Quantity";
quantitySummary.Summaries.Add(SummaryType.Sum);
quantitySummary.Summaries.Add(SummaryType.Max);
e.Band.Behaviors.SummaryRow.ColumnSummaries.Add(quantitySummary);
this.WebHierarchicalDataGrid1.RefreshBehaviors();
}
}