Version

SummaryDescriptionMask Property

Specifies what to display in the header of the summary record.
Syntax
'Declaration
 
Public Property SummaryDescriptionMask As String
public string SummaryDescriptionMask {get; set;}
Remarks

Each summary record by default displays a header above it. You can use SummaryDescriptionMask and SummaryDescriptionMaskInGroupBy properties to specify what's displayed inside the header. SummaryDescriptionMaskInGroupBy is used for any summary record whose parent record is a GroupByRecord. Otherwise SummaryDescriptionMask is used.

Summary description mask is a replacement string with specific tokens that will be replaced by their corresponding values. The following is a list of supported tokens:

Token Replacement Value
[GROUP_BY_VALUE] Parent group-by record's value.
[GROUP_BY_VALUES] Values of all the ancestor group-by records separated by ','.
[PRIMARY_FIELD] Value of the primary field (specified using Field's Field.IsPrimary property) in the parent data record.
[TREE_FIELD] Value of the tree field in the parent data record. If not in tree view then the value of the primary field will be used.
[SCROLLTIP_FIELD] Value of the scroll-tip field (specified using the Field's Field.IsScrollTipField property) in the parent data record.
[PARENT_FIELD_NAME] If the summary record is associated with a child record collection, this token will be replaced with the name of the parent expandable field.
[FieldName] Here the FieldName can be any field in the parent data record. This will be replaced with the value of that field in the parent data record.

If not explicitly set, this property is resolved as follows:

  • "Grand Summaries"
  • "Summaries for [PRIMARY_FIELD]"
    Note that when you have group-by records, SummaryDescriptionMaskInGroupBy will be used instead of this property.

NOTE: To hide the summary record header, use the FieldLayoutSetting's FieldLayoutSettings.SummaryDescriptionVisibility property.

Example
The following code demonstrates the usage of SummaryDescriptionVisibility, SummaryDescriptionMask and SummaryDescriptionMaskInGroupBy properties.

Imports Infragistics.Windows
Imports Infragistics.Windows.Editors
Imports Infragistics.Windows.DataPresenter

    Private Sub Window1_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
        _dp.DataSource = _dataSource

        ' By default summary records are displayed only at top level and not within nested
        ' group-by records. To demonstrate SummaryDescriptionMaskInGroupBy property, which applies
        ' to summary records inside nested group-by records, we need display summaries in nested 
        ' group-by records by setting SummaryDisplayArea to a value that doesn't contain 
        ' TopLevelOnly.
        ' 
        _dp.FieldSettings.SummaryDisplayArea = SummaryDisplayAreas.Bottom

        Dim fieldLayout As FieldLayout = _dp.FieldLayouts(0)

        ' Note that you actually have to set SummaryDescriptionVisibility, which we do further below, 
        ' to actually show the summary description.
        fieldLayout.SummaryDescriptionMask = "Grand Summaries"
        fieldLayout.SummaryDescriptionMaskInGroupBy = "Summaries for [GROUP_BY_VALUE]"

        ' Set SummaryDescriptionVisibility to actually show the summary description.
        fieldLayout.Settings.SummaryDescriptionVisibility = Visibility.Visible

        ' Add a summary - without at least one summary, the summary record will not be displayed.
        fieldLayout.SummaryDefinitions.Add(SummaryCalculator.Sum, "Price")

    End Sub
using Infragistics.Windows;
using Infragistics.Windows.Editors;
using Infragistics.Windows.DataPresenter;

		public void Window1_Loaded( object sender, RoutedEventArgs e )
		{
			_dp.DataSource = _dataSource;

			// By default summary records are displayed only at top level and not within nested
			// group-by records. To demonstrate SummaryDescriptionMaskInGroupBy property, which applies
			// to summary records inside nested group-by records, we need display summaries in nested 
			// group-by records by setting SummaryDisplayArea to a value that doesn't contain 
			// TopLevelOnly.
			// 
			_dp.FieldSettings.SummaryDisplayArea = SummaryDisplayAreas.Bottom;

			FieldLayout fieldLayout = _dp.FieldLayouts[0];

			// Note that you actually have to set SummaryDescriptionVisibility, which we do further below, 
			// to actually show the summary description.
			fieldLayout.SummaryDescriptionMask = "Grand Summaries";
			fieldLayout.SummaryDescriptionMaskInGroupBy = "Summaries for [GROUP_BY_VALUE]";

			// Set SummaryDescriptionVisibility to actually show the summary description.
			fieldLayout.Settings.SummaryDescriptionVisibility = Visibility.Visible;

			// Add a summary - without at least one summary, the summary record will not be displayed.
			fieldLayout.SummaryDefinitions.Add( SummaryCalculator.Sum, "Price" );
		}
        <igDP:XamDataGrid x:Name="_dp" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >

            
<igDP:XamDataGrid.FieldSettings>
                
<igDP:FieldSettings SummaryDisplayArea="Bottom" />
            
</igDP:XamDataGrid.FieldSettings>

            
<igDP:XamDataGrid.FieldLayouts>
                
<!--
                    Note that you actually have to set SummaryDescriptionVisibility, which we do further below, 
                    to actually show the summary description.
                
-->
                
<igDP:FieldLayout IsDefault="true" 
                        
SummaryDescriptionMask="Grand Summaries"
                        
SummaryDescriptionMaskInGroupBy="Summaries for [GROUP_BY_VALUE]"
                    
>
                    
<!-- Set SummaryDescriptionVisibility to actually show the summary description. -->
                    
<igDP:FieldLayout.Settings>
                        
<igDP:FieldLayoutSettings SummaryDescriptionVisibility="Visible" />
                    
</igDP:FieldLayout.Settings>
                    
                    
<!-- Add a summary - without at least one summary, the summary record will not be displayed -->
                    
<igDP:FieldLayout.SummaryDefinitions>
                        
<igDP:SummaryDefinition SourceFieldName="Price" Calculator="Average" />
                    
</igDP:FieldLayout.SummaryDefinitions>
                    
                
</igDP:FieldLayout>
            
</igDP:XamDataGrid.FieldLayouts>

        
</igDP:XamDataGrid>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, 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