<ig:XamGrid x:Name="MyGrid" AutoGenerateColumns="False"> <ig:XamGrid.SummaryRowSettings> <ig:SummaryRowSettings AllowSummaryRow="Top" SummaryScope="ColumnLayout"/> </ig:XamGrid.SummaryRowSettings> </ig:XamGrid>
We recommend that you use the xamDataGrid control instead of the xamGrid control. The xamGrid is being planned for retirement over the next few years and will not receive any new features. We will continue to provide support and critical bug fixes for the xamGrid during this time. For help or questions on migrating your codebase to the xamDataGrid, please contact support.
In some cases, your end users may be overwhelmed by the amount of data displayed in the xamGrid control, and often they may be just looking for a summary of the data. Your end users may also want to derive additional information from the data of a specific column. Row summaries help your end users achieve this.
You can enable row summaries for a column in xamGrid by setting the SummaryRowSettings object’s AllowSummaryRow to one of the following values of the RowSummaryLocation, which will determine where the summaries will be displayed, enumeration:
When you set the AllowSummaryRow property, xamGrid will display a summary button in the column header. Your end users can click/tap the summary button to display a summary selection dialog box. In the summary selection dialog box, they can select the row summaries they want to see.
When you are enabling summaries, there are different SummaryDefinitionCollection collections available, for example the column layout or the child band collections. The one that is used depends on the value of the SummaryRowSettings/SummaryRowSettingsOverride object’s SummaryScope property. You can set this property to one of the following SummaryScope enumeration:
ChildBand – Each child band of data will be summed independently.
ColumnLayout – All rows that share a ColumnLayout will be summed together.
For more information on column layouts, see the Define Column Layout topic.
You can also manually add summaries for a row using XAML or procedural code, for more information see Programmatically Add Summaries.
The following code demonstrates how to enable row summaries.
In XAML:
<ig:XamGrid x:Name="MyGrid" AutoGenerateColumns="False"> <ig:XamGrid.SummaryRowSettings> <ig:SummaryRowSettings AllowSummaryRow="Top" SummaryScope="ColumnLayout"/> </ig:XamGrid.SummaryRowSettings> </ig:XamGrid>
In Visual Basic:
Imports Infragistics.Controls.Grids .. Me.MyGrid.SummaryRowSettings.AllowSummaryRow = SummaryRowLocation.Top Me.MyGrid.SummaryRowSettings.SummaryScope = SummaryScope.ColumnLayout
In C#:
using Infragistics.Controls.Grids; … this.MyGrid.SummaryRowSettings.AllowSummaryRow = SummaryRowLocation.Top; this.MyGrid.SummaryRowSettings.SummaryScope = SummaryScope.ColumnLayout;