Version

GroupBySummaryDisplayStyle Enumeration

Enum for specifying UltraGridOverride.GroupBySummaryDisplayStyle property.
Syntax
'Declaration
 
Public Enum GroupBySummaryDisplayStyle 
   Inherits System.Enum
public enum GroupBySummaryDisplayStyle : System.Enum 
Members
MemberDescription
DefaultDefault is resolved to Text. This maintains the backward compatibility.
SummaryCellsSummaries are displayed as cells in group-by row. These summary cells are positioned according the SummarySettings’ SummaryPosition settings. If the summary cells do not intersect with the group-by row description then they are positioned in the same level as the description. If at least one summary cell intersects with the group-by row description then all the summary cells are positioned below the description.
SummaryCellsAlwaysBelowDescriptionSummaries are displayed as cells in group-by row. These summary cells are positioned according the SummarySettings’ SummaryPosition settings. All the summary cells are positioned below the description so they do not conflict with the group-by row description.
TextSummaries are appended to the group-by row’s description.
Example
Following code sets some of the row summaries functionality related properties.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

    Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout
        ' To allow the user to be able to add/remove summaries set the 
        ' AllowRowSummaries property. This does not have to be set to summarize
        ' data in code.
        e.Layout.Override.AllowRowSummaries = AllowRowSummaries.True

        ' Here is how you can add summary of a column in code. The retruned 
        ' SummarySettings object has properties for specifying the appearance,
        ' visibility and where it's displayed among other things.
        Dim columnToSummarize As UltraGridColumn = e.Layout.Bands(0).Columns("Total")
        Dim summary As SummarySettings = e.Layout.Bands(0).Summaries.Add("GrandTotal", SummaryType.Sum, columnToSummarize)
        summary.DisplayFormat = "Total = {0:c}"
        summary.Appearance.TextHAlign = HAlign.Right

        ' To display summary footer on the top of the row collections set the 
        ' SummaryDisplayArea property to a value that has the Top or TopFixed flag
        ' set. TopFixed will make the summary fixed (non-scrolling). Note that 
        ' summaries are not fixed in the child rows. TopFixed setting behaves
        ' the same way as Top in child rows. Default is resolved to Bottom (and
        ' InGroupByRows more about which follows).
        e.Layout.Override.SummaryDisplayArea = SummaryDisplayAreas.TopFixed

        ' By default UltraGrid does not display summary footers or headers of
        ' group-by row islands. To display summary footers or headers of group-by row
        ' islands set the SummaryDisplayArea to a value that has GroupByRowsFooter
        ' flag set.
        e.Layout.Override.SummaryDisplayArea = e.Layout.Override.SummaryDisplayArea Or SummaryDisplayAreas.GroupByRowsFooter

        ' If you want to to display summaries of child rows in each group-by row
        ' set the SummaryDisplayArea to a value that has SummaryDisplayArea flag
        ' set. If SummaryDisplayArea is left to Default then the UltraGrid by
        ' default displays summaries in group-by rows.
        e.Layout.Override.SummaryDisplayArea = e.Layout.Override.SummaryDisplayArea Or SummaryDisplayAreas.InGroupByRows

        ' SummaryDisplayArea property is expossed on the SummarySettings object as
        ' well allowing to control if and where the summary gets displayed on a
        ' per summary basis.
        summary.SummaryDisplayArea = SummaryDisplayAreas.BottomFixed _
                                        Or SummaryDisplayAreas.GroupByRowsFooter

        ' By default any summaries to be displayed in the group-by rows are displayed
        ' as text appended to the group-by row's description. You can set the 
        ' GroupBySummaryDisplayStyle property to SummaryCells or 
        ' SummaryCellsAlwaysBelowDescription to display summary values as a separate
        ' ui element (cell like element with border, to which the summary value related
        ' appearances are applied). Default value of GroupBySummaryDisplayStyle is resolved
        ' to Text.
        e.Layout.Override.GroupBySummaryDisplayStyle = GroupBySummaryDisplayStyle.SummaryCells

        ' Appearance of the summary area can be controlled using the 
        ' SummaryFooterAppearance. Even though the property's name contains the
        ' word 'footer', this appearance applies to summary area that is displayed
        ' on top as well (summary headers).
        e.Layout.Override.SummaryFooterAppearance.BackColor = SystemColors.Info

        ' Appearance of summary values can be controlled using the 
        ' SummaryValueAppearance property.
        e.Layout.Override.SummaryValueAppearance.BackColor = SystemColors.Window
        e.Layout.Override.SummaryValueAppearance.FontData.Bold = DefaultableBoolean.True

        ' Appearance of summary values that are displayed inside of group-by rows can 
        ' be controlled using the GroupBySummaryValueAppearance property. Note that
        ' this has effect only when the GroupBySummaryDisplayStyle is set to SummaryCells
        ' or SummaryCellsAlwaysBelowDescription.
        e.Layout.Override.GroupBySummaryValueAppearance.BackColor = SystemColors.Window
        e.Layout.Override.GroupBySummaryValueAppearance.TextHAlign = HAlign.Right

        ' Caption of the summary area can be set using the SummaryFooterCaption
        ' proeprty of the band.
        e.Layout.Bands(0).SummaryFooterCaption = "Grand Totals:"

        ' Caption's appearance can be controlled using the SummaryFooterCaptionAppearance
        ' property.
        e.Layout.Override.SummaryFooterCaptionAppearance.FontData.Bold = DefaultableBoolean.True

        ' By default summary footer caption is visible. You can hide it using the
        ' SummaryFooterCaptionVisible property.
        e.Layout.Override.SummaryFooterCaptionVisible = DefaultableBoolean.False

        ' SummaryFooterSpacingAfter and SummaryFooterSpacingBefore properties can be used
        ' to leave spacing before and after the summary footer.
        e.Layout.Override.SummaryFooterSpacingAfter = 5
        e.Layout.Override.SummaryFooterSpacingBefore = 5
    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;


		private void UltraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
		{
			// To allow the user to be able to add/remove summaries set the 
			// AllowRowSummaries property. This does not have to be set to summarize
			// data in code.
			e.Layout.Override.AllowRowSummaries = AllowRowSummaries.True;

			// Here is how you can add summary of a column in code. The retruned 
			// SummarySettings object has properties for specifying the appearance,
			// visibility and where it's displayed among other things.
			UltraGridColumn columnToSummarize = e.Layout.Bands[0].Columns["Total"];
			SummarySettings summary = e.Layout.Bands[0].Summaries.Add( "GrandTotal", SummaryType.Sum, columnToSummarize );
			summary.DisplayFormat = "Total = {0:c}";
			summary.Appearance.TextHAlign = HAlign.Right;

			// To display summary footer on the top of the row collections set the 
			// SummaryDisplayArea property to a value that has the Top or TopFixed flag
			// set. TopFixed will make the summary fixed (non-scrolling). Note that 
			// summaries are not fixed in the child rows. TopFixed setting behaves
			// the same way as Top in child rows. Default is resolved to Bottom (and
			// InGroupByRows more about which follows).
			e.Layout.Override.SummaryDisplayArea = SummaryDisplayAreas.TopFixed;

			// By default UltraGrid does not display summary footers or headers of
			// group-by row islands. To display summary footers or headers of group-by row
			// islands set the SummaryDisplayArea to a value that has GroupByRowsFooter
			// flag set.
			e.Layout.Override.SummaryDisplayArea |= SummaryDisplayAreas.GroupByRowsFooter;

			// If you want to to display summaries of child rows in each group-by row
			// set the SummaryDisplayArea to a value that has SummaryDisplayArea flag
			// set. If SummaryDisplayArea is left to Default then the UltraGrid by
			// default displays summaries in group-by rows.
			e.Layout.Override.SummaryDisplayArea |= SummaryDisplayAreas.InGroupByRows;

			// SummaryDisplayArea property is expossed on the SummarySettings object as
			// well allowing to control if and where the summary gets displayed on a
			// per summary basis.
			summary.SummaryDisplayArea = SummaryDisplayAreas.BottomFixed 
				| SummaryDisplayAreas.GroupByRowsFooter;

			// By default any summaries to be displayed in the group-by rows are displayed
			// as text appended to the group-by row's description. You can set the 
			// GroupBySummaryDisplayStyle property to SummaryCells or 
			// SummaryCellsAlwaysBelowDescription to display summary values as a separate
			// ui element (cell like element with border, to which the summary value related
			// appearances are applied). Default value of GroupBySummaryDisplayStyle is resolved
			// to Text.
			e.Layout.Override.GroupBySummaryDisplayStyle = GroupBySummaryDisplayStyle.SummaryCells;

			// Appearance of the summary area can be controlled using the 
			// SummaryFooterAppearance. Even though the property's name contains the
			// word 'footer', this appearance applies to summary area that is displayed
			// on top as well (summary headers).
			e.Layout.Override.SummaryFooterAppearance.BackColor = SystemColors.Info;

			// Appearance of summary values can be controlled using the 
			// SummaryValueAppearance property.
			e.Layout.Override.SummaryValueAppearance.BackColor = SystemColors.Window;
			e.Layout.Override.SummaryValueAppearance.FontData.Bold = DefaultableBoolean.True;

			// Appearance of summary values that are displayed inside of group-by rows can 
			// be controlled using the GroupBySummaryValueAppearance property. Note that
			// this has effect only when the GroupBySummaryDisplayStyle is set to SummaryCells
			// or SummaryCellsAlwaysBelowDescription.
			e.Layout.Override.GroupBySummaryValueAppearance.BackColor = SystemColors.Window;
			e.Layout.Override.GroupBySummaryValueAppearance.TextHAlign = HAlign.Right;

			// Caption of the summary area can be set using the SummaryFooterCaption
			// proeprty of the band.
			e.Layout.Bands[0].SummaryFooterCaption = "Grand Totals:";

			// Caption's appearance can be controlled using the SummaryFooterCaptionAppearance
			// property.
			e.Layout.Override.SummaryFooterCaptionAppearance.FontData.Bold = DefaultableBoolean.True;

			// By default summary footer caption is visible. You can hide it using the
			// SummaryFooterCaptionVisible property.
			e.Layout.Override.SummaryFooterCaptionVisible = DefaultableBoolean.False;

			// SummaryFooterSpacingAfter and SummaryFooterSpacingBefore properties can be used
			// to leave spacing before and after the summary footer.
			e.Layout.Override.SummaryFooterSpacingAfter = 5;
			e.Layout.Override.SummaryFooterSpacingBefore = 5;
		}
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