Version

AllowRowSummaries Property (UltraGridOverride)

Enables the user interface that lets the user add or remove column summaries. By default the functionality is disabled. Default is resolved to False.
Syntax
'Declaration
 
Public Property AllowRowSummaries As AllowRowSummaries
public AllowRowSummaries AllowRowSummaries {get; set;}
Remarks

AllowRowSummaries property determines whether the user will be allowed to add or remove row summaries. Enabling the row summaries will display a button in each column header that the user can use to summarize the column. By default the row summaries are disabled.

Note that this property controls whether the user interface for changing the summaries is enabled. It does not control whether you can display summaries or not. You can still display the summaries by adding them to the UltraGridBand.Summaries collection. You can add summaries in code using the SummarySettingsCollection.Add method of the SummarySettingsCollection object.

Example
Following code shows how to use row summaries feature in the UltraGrid. It summarizes UnitPrice column in band 2. It adds summaries to find Maximum and Average for UnitPrice column.

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;

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also