'宣言 Public Property DisplayArea As Nullable(Of SummaryDisplayAreas)
public Nullable<SummaryDisplayAreas> DisplayArea {get; set;}
DisplayArea プロパティは、このフィールドの集計計算結果が表示されるかどうか、またどこに表示されるのかを制御します。これはフラグ列挙体タイプです(SummaryDisplayAreas を参照)。したがって集計を表示する複数の表示領域を指定できます。FieldSettings の SummaryDisplayArea プロパティを設定して、フィールド単位で集計表示領域を指定することもできます。
デフォルトで、このプロパティは TopLevelOnly と InGroupByRecords に解決されます。これは集計が各グループ化レコード(グループ化レコードがある場合)に、また最上位のレコードに対して表示されることを意味します。詳細については、SummaryDisplayAreas 列挙体を参照してください。
ユーザーがフィールドで集計計算を実行できるようにする UI を有効にするには、FieldSettings の AllowSummaries プロパティを設定します。詳細は AllowSummaries を参照してください。
Imports Infragistics.Windows Imports Infragistics.Windows.Editors Imports Infragistics.Windows.DataPresenter Private Sub Window1_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs) ' Set the data source. _dp.DataSource = _dataSource ' SummaryDisplayArea property specifies where summaries are to be displayed. See help ' for SummaryDisplayAreas enum for a listing of all available options and description ' of each option. ' ' This particular setting will display summary results at bottom of records (BottomFixed) ' and furthermore the summary record will be fixed or non-scrolling for the root level. ' If there group-by records, it will display summaries in each group-by record (InGroupByRecords) ' and furthermore the summary record will only be displayed for the top level only ' (TopLevelOnly) which is a desirable behavior because summaries of lower levels are ' displayed inside each group-by record. ' _dp.FieldSettings.SummaryDisplayArea = SummaryDisplayAreas.BottomFixed _ Or SummaryDisplayAreas.InGroupByRecords Or SummaryDisplayAreas.TopLevelOnly Dim summaryDef1 As SummaryDefinition = _dp.FieldLayouts(0).SummaryDefinitions.Add( _ "PriceAverage", SummaryCalculator.Average, "Price") ' You can override where a specific summary gets displayed by using the summary ' definition's DisplayArea property. ' summaryDef1.DisplayArea = SummaryDisplayAreas.TopFixed _ Or SummaryDisplayAreas.InGroupByRecords Or SummaryDisplayAreas.TopLevelOnly ' If DisplayArea is not specified, it will use the FieldSetting's SummaryDisplayArea ' property setting. ' Dim summaryDef2 As SummaryDefinition = _dp.FieldLayouts(0).SummaryDefinitions.Add( _ "PriceSum", SummaryCalculator.Sum, "Price") End Sub
using Infragistics.Windows; using Infragistics.Windows.Editors; using Infragistics.Windows.DataPresenter; public void Window1_Loaded( object sender, RoutedEventArgs e ) { // Set the data source. _dp.DataSource = _dataSource; // SummaryDisplayArea property specifies where summaries are to be displayed. See help // for SummaryDisplayAreas enum for a listing of all available options and description // of each option. // // This particular setting will display summary results at bottom of records (BottomFixed) // and furthermore the summary record will be fixed or non-scrolling for the root level. // If there group-by records, it will display summaries in each group-by record (InGroupByRecords) // and furthermore the summary record will only be displayed for the top level only // (TopLevelOnly) which is a desirable behavior because summaries of lower levels are // displayed inside each group-by record. // _dp.FieldSettings.SummaryDisplayArea = SummaryDisplayAreas.BottomFixed | SummaryDisplayAreas.InGroupByRecords | SummaryDisplayAreas.TopLevelOnly; SummaryDefinition summaryDef1 = _dp.FieldLayouts[0].SummaryDefinitions.Add( "PriceAverage", SummaryCalculator.Average, "Price" ); // You can override where a specific summary gets displayed by using the summary // definition's DisplayArea property. // summaryDef1.DisplayArea = SummaryDisplayAreas.TopFixed | SummaryDisplayAreas.InGroupByRecords | SummaryDisplayAreas.TopLevelOnly; // If DisplayArea is not specified, it will use the FieldSetting's SummaryDisplayArea // property setting. // SummaryDefinition summaryDef2 = _dp.FieldLayouts[0].SummaryDefinitions.Add( "PriceSum", SummaryCalculator.Sum, "Price" ); }