Skip to main content

Lesson 2 - Displaying Summary Information

This lesson shows how to display summary information (Count, Max, Min, Sum, etc.) against individual columns - total summary.

  • Create Total Summaries

    A total summary is an aggregate function value calculated over all data rows within a grid and displayed within the Fixed Summary Panel. Summaries within the Fixed Summary Panel are always displayed onscreen and not horizontally scrolled.

    Total summaries are represented by SummaryItemBase objects and stored within the GridControl.TotalSummary collection.

    Create two summary items. One item to display the total number of rows within the grid, another item to display the maximum product price.

    <Grid:GridControl.TotalSummary>
        <Grid:GridSummaryItem FieldName="ProductName" SummaryType="Count" Alignment="Left"/>
        <Grid:GridSummaryItem FieldName="UnitPrice" SummaryType="Max" Alignment="Right"/>
    </Grid:GridControl.TotalSummary>
    

    Note

    Total summaries can be displayed either to the summary panel’s left or right. The horizontal alignment is specified by the SummaryItemBase.Alignment property.

  • Display Summary Information

    Set the grid’s DataControlBase.ShowFixedTotalSummary property to true to display the fixed summary panel.

  • Result

    Run the application. The image below shows the result.

    grid_totalsummary

See Also