SummaryItemBase.FieldName Property
Gets or sets the name of a data source field whose values are used for summary calculation. This is a dependency property.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v24.1.Core.dll
NuGet Package: DevExpress.Wpf.Grid.Core
Declaration
Property Value
Type | Description |
---|---|
String | A String value that specifies the name of the data source field whose values are used for summary calculation. |
Example
The following example shows how to calculate group summaries and display them within group rows. A group summary is a value of the aggregate function calculated over all data rows within a group. The GridControl‘s GroupSummary collection stores group summary items.
This example uses the GridControl.CustomSummaryExists event to calculate group summaries only for the top group level:
<dxg:GridControl x:Name="grid" CustomSummaryExists="OnCustomSummaryExists">
<dxg:GridControl.View>
<dxg:TableView AutoWidth="True"/>
</dxg:GridControl.View>
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="UserName" />
<dxg:GridColumn FieldName="RegistrationDate" />
<dxg:GridColumn FieldName="Married" GroupIndex="0" SortOrder="Ascending" />
<dxg:GridColumn FieldName="Age" />
</dxg:GridControl.Columns>
<dxg:GridControl.GroupSummary>
<dxg:GridSummaryItem FieldName="Age" SummaryType="Min"/>
<dxg:GridSummaryItem FieldName="Age" SummaryType="Max"/>
</dxg:GridControl.GroupSummary>
</dxg:GridControl>
void OnCustomSummaryExists(object sender, CustomSummaryExistEventArgs e) {
e.Exists = e.GroupLevel == 0;
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the FieldName property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.