バージョン

Add(String,SummaryType,UltraGridColumn,SummaryPosition) メソッド

指定した引数を使用して作成された新しいSummarySettingsオブジェクトを追加し、そのSummarySettingsオブジェクトを返します。
シンタックス
'宣言
 
Public Overloads Function Add( _
   ByVal key As String, _
   ByVal summaryType As SummaryType, _
   ByVal sourceColumn As UltraGridColumn, _
   ByVal summaryPosition As SummaryPosition _
) As SummarySettings

パラメータ

key
コレクション内のオブジェクトを一意に識別する値。
summaryType
SummaryType。このオーバー読み込みで、非 Custom 集計タイプを指定する必要があります。カスタム集計を指定するために異なるオーバー読み込みを使用します。
sourceColumn
集計されるフィールド。
summaryPosition
集計がグリッドで表示される場所を指定します。

戻り値の型

新しい SummarySettings オブジェクトを作成し、それを提供される引数と共にコレクションに追加します。
解説

渡された引数に基づいて新しいSummarySettingsオブジェクトを作成し、それをコレクションに追加します。

summaryType が SummaryType.Custom の場合、このオーバー読み込みは例外をスローします。カスタム集計を指定するために ICustomSummaryCalculator 引数をとるオーバー読み込みを使用してください。

SourceColumn には、集計対象のデータを含む列を指定します。sourceColumn は、この SummarySettingsCollection に関連付けられたバンドか、その子孫バンドの列である必要があります。

summaryPosition が SummaryPosition.UseSummaryPositionColumn の場合、集計はソース列の下に表示されます。

使用例
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub Button13_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button13.Click

      Dim band As UltraGridBand = Me.ultraGrid1.DisplayLayout.Bands(1)

      ' Add a summary.
      Dim summary As SummarySettings = band.Summaries.Add(SummaryType.Count, band.Columns("CustomerID"))

      ' Set the summary position to Left so that it shows up on the left of the
      ' summary footer area.
      summary.SummaryPosition = SummaryPosition.Left

      ' Set the format with which to format the calculated summary when displaying
      ' in the summary footer.
      summary.DisplayFormat = "Record Count = {0:#####}"

      ' Set the appearance of the summary.
      summary.Appearance.TextHAlign = HAlign.Left
      summary.Appearance.ForeColor = Color.DarkBlue
      summary.Appearance.BackColor = Color.White

      ' Set the border style of summaries to desired value.
      band.Override.BorderStyleSummaryValue = UIElementBorderStyle.None

      ' Set the appearance of summary footer and the footer caption.
      band.Override.SummaryFooterAppearance.BackColor = Color.White
      band.Override.SummaryFooterCaptionAppearance.BackColor = Color.White

      ' Set the text that shows up in the caption of the summary footer.
      ' You can use column names in square brackets like (CustomerID) below.
      band.SummaryFooterCaption = "Customer ID: (CustomerID)"

  End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button13_Click(object sender, System.EventArgs e)
{

	UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[1];
	
	// Add a summary.
	SummarySettings summary = band.Summaries.Add( SummaryType.Count, band.Columns["CustomerID"] );			
	
	// Set the summary position to Left so that it shows up on the left of the
	// summary footer area.
	summary.SummaryPosition = SummaryPosition.Left;
	
	// Set the format with which to format the calculated summary when displaying
	// in the summary footer.
	summary.DisplayFormat = "Record Count = {0:#####}";
			
	// Set the appearance of the summary.
	summary.Appearance.TextHAlign = HAlign.Left;
	summary.Appearance.ForeColor = Color.DarkBlue;
	summary.Appearance.BackColor = Color.White;

	// Set the border style of summaries to desired value.
	band.Override.BorderStyleSummaryValue = UIElementBorderStyle.None;

	// Set the appearance of summary footer and the footer caption.
	band.Override.SummaryFooterAppearance.BackColor = Color.White;
	band.Override.SummaryFooterCaptionAppearance.BackColor = Color.White;

	// Set the text that shows up in the caption of the summary footer.
	// You can use column names in square brackets like [CustomerID] below.
	band.SummaryFooterCaption = "Customer ID: [CustomerID]";

}
参照