Class GridSummaryColumn
Represents a class that implements ISummaryColumn that contains properties exposed through ISummaryColumn for getting information on the summary values to be computed for the Groups.
Inheritance
Namespace: Syncfusion.SfDataGrid
Assembly: Syncfusion.SfDataGrid.iOS.dll
Syntax
public class GridSummaryColumn : Object, ISummaryColumn, IDisposable
Constructors
GridSummaryColumn()
Initializes a new instance of the GridSummaryColumn class.
Declaration
public GridSummaryColumn()
Properties
CustomAggregate
Gets or sets the custom aggregate of the GridSummary column. SfDataGrid provides the built in aggregate types for calculating the values for the GridSummary column in the SummaryType of the GridSummaryColumn. The user can implement their own aggregate function when the built in aggregate function does not meet his requirement using this property. When the user defines his own aggregate function in the CustomAggregate, he needs to set the SummaryType as Custom.
Declaration
public ISummaryAggregate CustomAggregate { get; set; }
Property Value
Type | Description |
---|---|
ISummaryAggregate | The custom aggregate of the GridSummary column. |
Remarks
SfDataGrid allows you to implement your own aggregate functions, when the built-in aggregate functions do not meet your requirement.The user can calculate the summary values based on custom logic using this property. When the user defines his own aggregate function in the CustomAggregate, he needs to set the SummaryType as Custom.
Examples
GridSummaryRow summaryRow = new GridSummaryRow();
summaryRow.SummaryColumns.Add(new GridSummaryColumn
{
Name = "CaptionSummary",
CustomAggregate = new CustomAggregate(),
MappingName = "OrderID",
SummaryType = SummaryType.Custom
});
//CustomAggregate.cs
public class CustomAggregate : ISummaryAggregate
{
}
See Also
Format
Gets or sets the format to be applied to the summary value. The user can format the summary value by setting the appropriate format after the aggregate function followed by a colon(:) in Format property.
Declaration
public string Format { get; set; }
Property Value
Type | Description |
---|---|
System.String | The format to be applied to the summary value. |
Examples
GridSummaryRow summaryRow = new GridSummaryRow();
summaryRow.SummaryColumns.Add(new GridSummaryColumn
{
Name = "CaptionSummary",
MappingName = "Salary",
Format = "{Sum:c}",
SummaryType = SummaryType.DoubleAggregate
});
See Also
MappingName
Gets or sets the mapping name of the summary column, that is used for summary calculation.
Declaration
public string MappingName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The column name to be used for summary calculation. |
Examples
GridSummaryRow summaryRow = new GridSummaryRow();
summaryRow.SummaryColumns.Add(new GridSummaryColumn
{
Name = "CaptionSummary",
MappingName = "Salary",
Format = "{Sum:c}",
SummaryType = SummaryType.DoubleAggregate
});
See Also
Name
Gets or sets the name of the summary column that helps to denote the GridSummaryColumn in Title. The user can format the summary value for row using Title when ShowSummaryInRow set to true.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String | The name of the summary column. |
Remarks
The caption of the summary can be displayed either in the summary row or summary column, if the caption is displayed in the summary row by setting ShowSummaryInRow as true. The summary row defines the Title which makes use of the Name to display its value.
Examples
GridSummaryRow summaryRow = new GridSummaryRow();
summaryRow.ShowSummaryInRow = true;
summaryRow.Title = "Total Salary:{TotalSalary}";
summaryRow.SummaryColumns.Add(new GridSummaryColumn
{
Name = "TotalSalary",
MappingName = "Salary",
Format = "{Sum:c}",
SummaryType = SummaryType.DoubleAggregate
});
See Also
SummaryMode
Gets or sets a value�that decides�whether summary calculation is processed based on display value in case of indexer and complex properties or default value in case of CLR properties of the column.
Declaration
public DataReflectionMode SummaryMode { get; set; }
Property Value
Type | Description |
---|---|
DataReflectionMode | The DataReflectionMode that decides�whether summary calculation is processed based on display value or default value. The default value is Default. |
Remarks
By default, the summary for the column will be calculalted using DataReflectionMode Defaultonly. For complex properties use DataReflectionMode.Display to fetch values using custom logic. For simple CLR properties use DataReflectionMode.Default to fetch values using default logic.
Examples
GridTableSummaryRow summaryRow1 = new GridTableSummaryRow();
summaryRow1.SummaryColumns.Add(new GridSummaryColumn()
{
Name = "TotalSalary",
MappingName = "OrderID[0]",
Format = "{Sum:c}",
SummaryType = SummaryType.DoubleAggregate,
SummaryMode = DataReflectionMode.Display
}
SummaryType
Gets or sets a value indicating the summary type of the GridSummary column for calculating values of the GridSummary column. SfDataGrid provides the built in aggregate types for calculating the values for the GridSummary column in the SummaryType. The user can implement their own aggregate function when the built in aggregate function does not meet his requirement using CustomAggregate property.
Declaration
public SummaryType SummaryType { get; set; }
Property Value
Type | Description |
---|---|
SummaryType | The SummaryType of the summary column. |
Remarks
SfDataGrid provides the built in aggregate types for calculating the values for the GridSummary column in the SummaryType. The user can implement their own aggregate function when the built in aggregate function does not meet his requirement using CustomAggregate property.
Examples
GridSummaryRow summaryRow = new GridSummaryRow();
summaryRow.SummaryColumns.Add(new GridSummaryColumn
{
Name = "TotalSalary",
MappingName = "Salary",
Format = "{Sum:c}",
SummaryType = SummaryType.DoubleAggregate
});
See Also
Methods
Dispose()
Releases the resources used by the component.
Declaration
public void Dispose()
Dispose(Boolean)
Releases the unmanaged resources used by the component and optionally releases the managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | if true - release both managed and unmanaged resources; if false - release only unmanaged resources. |