Infragistics(R) NetAdvantage(R) Windows Forms
SummaryPosition Enumeration
Example  See Also  E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace : SummaryPosition Enumeration

Indicates the location where a summary will be displayed.

Syntax

Visual Basic (Declaration) 
Public Enum SummaryPosition 
   Inherits System.Enum
C# 
public enum SummaryPosition : System.Enum 

Members

MemberDescription
Center The summary will be displayed on the center of the footer. If there are multiple SummarySettings objects with Center as the ShowLocation, then they will be displayed in order that they occur in the SummarySettingsCollection they belong to.
Left The summary will be displayed on the left of the footer. If there are multiple SummarySettings objects with Left as the ShowLocation, then they will be displayed in order that they occur in the SummarySettingsCollection they belong to.
Right The summary will be displayed on the right of the footer. If there are multiple SummarySettings objects with Right as the ShowLocation, then they will be displayed in order that they occur in the SummarySettingsCollection they belong to.
UseSummaryPositionColumn If UseLocationColumn is specified, then the summary will be displayed under the LocationColumn. If LocationColumn is null, then the summary won't be displayed at all. LocationColumn column must be from the same band as the band SummariesCollection is from. If an attemt is made to assign a column not from the same band, an exception will be throw.

Example

Following code illustrates how to programatically add summaries in code. It adds a Count summary for CusomerID column for displaying number of records on the bottom of every rows collection in band 1.

Visual BasicCopy Code
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
C#Copy Code
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]";

}

Remarks

See Also