Class GridSummaryColumn
Represents a class that defines the summary calculation based on particular column.
Inheritance
Implements
Namespace: Syncfusion.UI.Xaml.DataGrid
Assembly: Syncfusion.Grid.WinUI.dll
Syntax
public class GridSummaryColumn : DependencyObject, ISummaryColumn
Constructors
GridSummaryColumn()
Declaration
public GridSummaryColumn()
Fields
CustomAggregateProperty
Identifies the CustomAggregate dependency property.
Declaration
public static readonly DependencyProperty CustomAggregateProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
Remarks
The identifier for the CustomAggregate dependency property.
FormatProperty
Identifies the Format dependency property.
Declaration
public static readonly DependencyProperty FormatProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
Remarks
The identifier for the Format dependency property.
MappingNameProperty
Identifies the MappingName dependency property.
Declaration
public static readonly DependencyProperty MappingNameProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
Remarks
The identifier for the MappingName dependency property.
NameProperty
Identifies the Name dependency property.
Declaration
public static readonly DependencyProperty NameProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
Remarks
The identifier for the Name dependency property.
SummaryTypeProperty
Identifies the SummaryType dependency property.
Declaration
public static readonly DependencyProperty SummaryTypeProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
Remarks
The identifier for the SummaryType dependency property.
Properties
CustomAggregate
Gets or sets the instance of ISummaryAggregate to implement the custom summary.
Declaration
public ISummaryAggregate CustomAggregate { get; set; }
Property Value
Type | Description |
---|---|
ISummaryAggregate | An instance of ISummaryAggregate. The default value is null. |
Format
Gets or sets the string that indicates how the summary value is formatted in display.
Declaration
public string Format { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string that specifies the format of summary value.The default value is |
Examples
this.dataGrid.TableSummaryRows.Add(new GridSummaryRow()
{
Name="Total Products",
ShowSummaryInRow = true,
Title = "Total Products Count: {ProductCount}",
SummaryColumns = new ObservableCollection<ISummaryColumn>()
{
new GridSummaryColumn()
{
Name="ProductCount",
MappingName="ProductName",
SummaryType=SummaryType.CountAggregate,
Format="{Count:d}"
},
}
});
MappingName
Gets or sets the corresponding MappingName of the column.
Declaration
public string MappingName { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string that specifies the valid mapping name of column. The default value is |
Name
Gets or sets the name of summary column.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string that specifies the name of the summary column. The default value is |
Remarks
The name of the summary column and Title should be same for displaying summary value with title.
Examples
//Here, the Title and Name have the same ProductCount string.
this.dataGrid.TableSummaryRows.Add(new GridSummaryRow()
{
Name="Total Products",
ShowSummaryInRow = true,
Title = "Total Products Count: {ProductCount}",
SummaryColumns = new ObservableCollection<ISummaryColumn>()
{
new GridSummaryColumn()
{
Name="ProductCount",
MappingName="ProductName",
SummaryType=SummaryType.CountAggregate,
Format="{Count:d}"
},
}
});
SummaryType
Gets or sets the aggregate type for summary calculation.
Declaration
public SummaryType SummaryType { get; set; }
Property Value
Type | Description |
---|---|
SummaryType | One of the SummaryType enumeration to specifies the aggregate type for summary calculation. The default value is CountAggregate. |
Template
Gets or sets the Microsoft.UI.Xaml.DataTemplate used to display the summary cell.
Declaration
public DataTemplate Template { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DataTemplate | An instance of DataTemplate. |
TemplateSelector
Gets or sets the custom logic for choosing a Microsoft.UI.Xaml.DataTemplate used to display the summary cell.
Declaration
public DataTemplateSelector TemplateSelector { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.UI.Xaml.Controls.DataTemplateSelector | An Instance of DataTemplateSelector. |