Interface ISummaryColumn
Defines common functionality for GridSummaryColumn for calculating and displaying the summary value.
Namespace: Syncfusion.Data
Assembly: Syncfusion.Data.Portable.dll
Syntax
public interface ISummaryColumn
Properties
CustomAggregate
Gets or sets the instance of ISummaryAggregate to implement the custom summary.
Declaration
ISummaryAggregate CustomAggregate { get; set; }
Property Value
Type | Description |
---|---|
ISummaryAggregate | An instance of ISummaryAggregate to implement the custom summary. The default value is null. |
Format
Gets or sets the string that indicates how the summary value is formatted in display.
Declaration
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 based on which the aggregate values of the summary column is to be calculated.
Declaration
string MappingName { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string that specifies the corresponding MappingName of the column based on which the aggregate
values of the summary column is to be calculated. The default value is |
Name
Gets or sets the name of summary column.
Declaration
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 in the summary row, when the ShowSummaryInRow is true.
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}"
},
}
});
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
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",
Format = "{Sum:c}",
SummaryType = SummaryType.DoubleAggregate,
SummaryMode = DataReflectionMode.Display
}
SummaryType
Gets or sets the aggregate type for summary calculation.
Declaration
SummaryType SummaryType { get; set; }
Property Value
Type | Description |
---|---|
SummaryType | One of the SummaryType enumeration to specifies aggregate type for summary calculation. The default value is CountAggregate. |