バージョン

AllowRowSummaries プロパティ (UltraGridOverride)

ユーザーが列集計を追加または削除するためのユーザー インターフェイスを有効にします。デフォルトでは、この機能は無効になっています。デフォルトは False に解決されます。
シンタックス
'宣言
 
Public Property AllowRowSummaries As AllowRowSummaries
public AllowRowSummaries AllowRowSummaries {get; set;}
解説

AllowRowSummaries プロパティは、ユーザーが行集計を追加または削除できるかどうかを決定します。行集計を有効にすると、ユーザーが列を集計するために使用できる各列ヘッダーにボタンが表示されます。デフォルトでは行集計は無効です。

注意:このプロパティは集計を変更するためのユーザー インターフェイスが有効かどうかを制御します。集計を表示できるかどうかを制御しません。UltraGridBand.Summaries コレクションに集計を追加することで表示できます。SummarySettingsCollection オブジェクトの SummarySettingsCollection.Add メソッドを使用してコードに集計を追加できます。

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

  Private Sub Button15_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button15.Click

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

      ' Set the AllowRowSummaries to either True or BasedOnDataType to allow
      ' the user to be able to add, remove or modify summaries. This is not 
      ' necessary to create summaries programmatically and only effects the 
      ' users ability to create, remove or modify summaries.
      band.Override.AllowRowSummaries = AllowRowSummaries.BasedOnDataType

      ' You can also prevent the user from adding, removing or modifying a
      ' summary on a column basis. Prevent the user from summarizing OrderID 
      ' column.
      band.Columns("OrderID").AllowRowSummaries = AllowRowSummaries.False
      band.Columns("ProductID").AllowRowSummaries = AllowRowSummaries.False

      ' Add summaries. Notice the keys "Max" and "Avg". We will use them to
      ' identify the summaries later on for example in SummaryValueChanged
      ' event.
      Dim maxSummary As SummarySettings = band.Summaries.Add("Max", SummaryType.Maximum, band.Columns("Unit Price"))
      Dim avgSummary As SummarySettings = band.Summaries.Add("Avg", SummaryType.Average, band.Columns("Unit Price"))

      ' Set the format of the summary text
      maxSummary.DisplayFormat = "Min = {0:#####.00}"
      avgSummary.DisplayFormat = "Avg = {0:#####.00}"

      ' Change the appearance settings for summaries.
      maxSummary.Appearance.TextHAlign = HAlign.Right
      avgSummary.Appearance.TextHAlign = HAlign.Right

      ' Set the DisplayInGroupBy property of both summaries to false so they don't
      ' show up in group-by rows.
      maxSummary.DisplayInGroupBy = False
      avgSummary.DisplayInGroupBy = False

      ' Set the caption that shows up on the header of the summary footer.
      band.SummaryFooterCaption = "Summary of Unit Price"
      band.Override.SummaryFooterCaptionAppearance.FontData.Bold = DefaultableBoolean.True
      band.Override.SummaryFooterCaptionAppearance.BackColor = Color.DarkBlue
      band.Override.SummaryFooterCaptionAppearance.ForeColor = Color.LightYellow

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

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

	UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[2];

	// Set the AllowRowSummaries to either True or BasedOnDataType to allow
	// the user to be able to add, remove or modify summaries. This is not 
	// necessary to create summaries programmatically and only effects the 
	// users ability to create, remove or modify summaries.
	band.Override.AllowRowSummaries = AllowRowSummaries.BasedOnDataType;

	// You can also prevent the user from adding, removing or modifying a
	// summary on a column basis. Prevent the user from summarizing OrderID 
	// column.
	band.Columns["OrderID"].AllowRowSummaries = AllowRowSummaries.False;
	band.Columns["ProductID"].AllowRowSummaries = AllowRowSummaries.False;
	
	// Add summaries. Notice the keys "Max" and "Avg". We will use them to
	// identify the summaries later on for example in SummaryValueChanged
	// event.
	SummarySettings maxSummary = band.Summaries.Add( "Max", SummaryType.Maximum, band.Columns["Unit Price"] );
	SummarySettings avgSummary = band.Summaries.Add( "Avg", SummaryType.Average, band.Columns["Unit Price"] );

	// Set the format of the summary text
	maxSummary.DisplayFormat = "Min = {0:#####.00}";
	avgSummary.DisplayFormat = "Avg = {0:#####.00}";

	// Change the appearance settings for summaries.
	maxSummary.Appearance.TextHAlign = HAlign.Right;
	avgSummary.Appearance.TextHAlign = HAlign.Right;			

	// Set the DisplayInGroupBy property of both summaries to false so they don't
	// show up in group-by rows.
	maxSummary.DisplayInGroupBy = false;
	avgSummary.DisplayInGroupBy = false;

	// Set the caption that shows up on the header of the summary footer.
	band.SummaryFooterCaption = "Summary of Unit Price";
	band.Override.SummaryFooterCaptionAppearance.FontData.Bold = DefaultableBoolean.True;
	band.Override.SummaryFooterCaptionAppearance.BackColor = Color.DarkBlue;
	band.Override.SummaryFooterCaptionAppearance.ForeColor = Color.LightYellow;

}
参照