• North American Sales: 1-800-231-8588
  • Global Contacts
  • My Account
Infragistics Infragistics
Menu
  • North American Sales: 1-800-321-8588
  • My Account
    • Sign In/Register
  • Design & DevelopmentDesign & Develop
    • Best Value
      Infragistics Ultimate The complete toolkit for building high performing web, mobile and desktop apps.
      Indigo.Design Use a unified platform for visual design, UX prototyping, code generation and application development.
    • Web
      Ignite UI for Angular Ignite UI for JavaScript Ignite UI for React Ultimate UI for ASP.NET Indigo.Design
    • Desktop
      Ultimate UI for Windows Forms Ultimate UI for WPF
      Prototyping
      Indigo.Design
    • Mobile
      Ultimate UI for Xamarin Ultimate UI for iOS Ultimate UI for Android
    • Automated Testing Tools
      Test Automation for Micro Focus UFT: Windows Forms Test Automation for Micro Focus UFT: WPF Test Automation for IBM RFT: Windows Forms
  • UX
    • Indigo.Design Desktop Collaborative prototyping and remote usability testing for UX & usability professionals
    • Indigo.Design A Unified Platform for Visual Design, UX Prototyping, Code Generation, and App Development
  • Business Intelligence
    • Reveal Embedded Accelerate your time to market with powerful, beautiful dashboards into your apps
    • Reveal App Empower everyone in your organization to use data to make smarter business decisions
  • Team Productivity
  • Learn & Support Support
    • Help & Support Documents
    • Blogs
    • Forums
    • Product Ideas
    • Reference Applications
    • Customer Stories
    • Webinars
    • eBook & Whitepapers
    • Events
  • Free Trials
  • Pricing
    • Product Pricing / Buy Online
    • Renew Existing License
    • Contact Us
WPF
  • Product Platforms
  • More
WPF
WPF Enabling Row Summaries in the XamDataGrid
  • Blog
  • Files
  • Wiki
  • Mentions
  • Tags
  • More
  • Cancel
  • New
WPF requires membership for participation - click to join
  • WPF
  • Configuring the XamTab Control
  • Creating a Custom Summary for the XamDataGrid
  • Defining a Custom Path in the XamCarousel
  • Enabling Row Summaries in the XamDataGrid
  • Exporting the XamDataGrid to Excel
  • Hosting a WPF Control in a Windows Forms Application
  • Printing the XamDataGrid with Infragistics.Reports
  • Spell Checking in the XamDataGrid
  • Tangerine -- A WPF Reference Application
  • Using the Infragistics WinGrid in a WPF Application
  • Validation in the XamDataGrid
  • XamDataGrid :: Copying to Excel via the Clipboard
  • XML Databinding with the XamDataGrid

Enabling Row Summaries in the XamDataGrid

Introduction

Row Summaries or Row Aggregation is a feature that is enabled on the XamDataGrid quickly and easily by setting a couple of properties. The first property that needs to be set is the “AllowSummaries.” This property is off of the FieldSettings Object. By setting this property to true; the end user is now able to have a drop down button that shows a collection of standard summaries. (This is customizable and your own custom calculation could be added.)

<igDP:XamDataGrid x:Name="xamDataGrid1" DataSource="{Binding}">
  <igDP:XamDataGrid.FieldLayouts>
    <igDP:FieldLayout>
      <igDP:FieldLayout.FieldSettings>
        <igDP:FieldSettings AllowSummaries="True" SummaryUIType="Default" />    
      </igDP:FieldLayout.FieldSettings> 
    </igDP:FieldLayout>
  </igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>

The next property of importance to the row summary capabilities is the SummaryUIType property. This property defines whether the end-user is able to select a single calculation or multiple (e.g. Count and Sum or only Count). The enumeration for this property has five values:

  • Multi-Select – User can select multiple calculations for all columns
  • Multi-Select for Numerics Only – User can select multiple calculations and no calculations on non-numeric based columns
  • Single-Select – User can only select a single calculation at a given time.
  • Single-Select for Numerics Only – User can only select a single calculation at a given time and no calculations on non-numeric based columns.
  • Default – Multi-Select for Numerics Only

The last core property for Row Summaries in the XamDataGrid is the SummaryDisplayArea property. This, like the name implies, controls how and where summaries are displayed. The enum for this property contains eight possibilities:

  • None – Summary is hidden
  • Top – Summary is displayed at the top of the XamDataGrid
  • TopFixed – Summary is displayed at the top of the XamDataGrid and does not move when the grid is scrolled.
  • Bottom – Summary is displayed at the bottom of the XamDataGrid
  • BottomFixed – Summary is displayed at the bottom of the XamDataGrid and stays in view when the grid is scrolled
  • TopLevelOnly – This option effects a group-by display scenario and will only show records for the top level record collection (By default summary records are displayed at all levels.)
  • DataRecordsOnly – Summary records are displayed for DataRecordsOnly. When the XamDataGrid is in groupby mode, the summary records are not displayed.
  • InGroupByRecords – Summaries are displayed in each of the group-by records.
  • Default – TopLevelOnly and InGroupByRecords

Lastly, all of the above properties can be set procedurally as follows:

using Infragistics.Windows.DataPresenter;
...
this.xamDataGrid1.FieldSettings.AllowSummaries = true;
this.xamDataGrid1.FieldSettings.SummaryUIType = SummaryUIType.MultiSelect;
this.xamDataGrid1.FieldSettings.SummaryDisplayArea =     
    SummaryDisplayAreas.InGroupByRecords | SummaryDisplayAreas.BottomFixed;
...
  • WPF
  • XamDataGrid
  • Aggregation
  • Share
  • History
  • More
  • Cancel
Related
Recommended