Version

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.

Programmatically Add Summaries

You can display summaries for a column using XAML or procedural code without your end user selecting a summary calculator from the summary selection dialog box.

This can be achieved by setting the individual SummaryOperand’s IsApplied property to True.

In XAML:

<Grid x:Name="LayoutRoot" Background="White">
    <ig:XamGrid x:Name="MyDataGrid" AutoGenerateColumns="False">
        <ig:XamGrid.SummaryRowSettings>
            <ig:SummaryRowSettings AllowSummaryRow="Top" SummaryScope="ColumnLayout">
        </ig:SummaryRowSettings>
    </ig:XamGrid.SummaryRowSettings>
    <ig:XamGrid.Columns>
        <ig:TextColumn Key="ProductID" />
        <ig:TextColumn Key="ProductName">
            <ig:TextColumn.SummaryColumnSettings>
                <ig:SummaryColumnSettings>
                    <ig:SummaryColumnSettings.SummaryOperands>
                        <ig:CountSummaryOperand IsApplied="True" />
                        <ig:MaximumSummaryOperand />
                        <ig:MinimumSummaryOperand />
                    </ig:SummaryColumnSettings.SummaryOperands>
               </ig:SummaryColumnSettings>
            </ig:TextColumn.SummaryColumnSettings>
        </ig:TextColumn>
         …
      </ig:XamGrid.Columns>
   </ig:XamGrid>
</Grid>

In Visual Basic:

Imports Infragistics.Controls.Grids
…
Dim DisplaySummary As Column = Me.MyDataGrid.Columns.DataColumns("ProductName")
DisplaySummary.SummaryColumnSettings.SummaryOperands(0).IsApplied = True

In C#:

using Infragistics.Controls.Grids;
…
Column DisplaySummary = this.MyDataGrid.Columns.DataColumns["ProductName"];
DisplaySummary.SummaryColumnSettings.SummaryOperands[0].IsApplied = true;