• About
    • Blog
    • Business Process
    • Charity Work
    • History
    • News
  • Services
    • Legacy System Support
    • Bespoke System Development
    • Web Design & Development
    • View all services
  • Products
  • Our work
    • Customers
    • Case Studies
  • Careers
  • Contact
Microsoft Partner - Application Development
8th May 2015

DevExpress XAF – Add a List View Group Footer

Bespoke Development C# Custom Development Custom Fields DevExpress List View PSP Knowledge
DevExpress XAF – Add a List View Group Footer

Scenario

DevExpress by default gives you the functionality within the Model to group list views together based on a selected field and show a count of records within the Group Header as seen in the screenshot below.

A user can then expand each group to see each individual record. To give the user a better understanding and overview of the records we wish to add a group footer to each group and display a total of the Time In Days spent against each group.

Solution

Within the Module.Win project create a new blank View Controller and customise the code below as required within it to get the results you require.

/// <summary>
/// Called when [view controls created].
/// </summary>
protected override void OnViewControlsCreated()

base.OnViewControlsCreated(); if (View.Id == "MyListView")

GridControl grid = (GridControl)View.Control; GridView view = (GridView)grid.FocusedView; view.Columns.View.OptionsSelection.MultiSelect = true; view.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect; view.OptionsView.GroupFooterShowMode = GroupFooterShowMode.VisibleAlways; GridColumn timeValueColumn = view.Columns["TimeInDays"]; GridGroupSummaryItem timeValueSummaryItem = new GridGroupSummaryItem(); timeValueSummaryItem.FieldName = "TimeInDays"; timeValueSummaryItem.SummaryType = SummaryItemType.Sum; timeValueSummaryItem.DisplayFormat = "Personnel Total (Days) =

0:n2

"; timeValueSummaryItem.Tag = 1; timeValueSummaryItem.ShowInGroupColumnFooter = timeValueColumn; view.GroupSummary.Add(timeValueSummaryItem);


Implementing the above code creates a group footer against each group and displays a count of the Time In Days of each record within the group.

Share:
PSP IT Design & Development
About Us
  • Privacy Policy
  • History
  • Customers
  • News
  • Blogs
Services
  • Legacy System Modernisation
  • Website Design & Development
  • Bespoke Application Development
  • Outsource IT Strategy
  • All Services
Contact
  • 01775 722377
  • letstalk@psp-it.co.uk
  • Carver House, Apex Court, Spalding Office Park, Elsoms Way, Pinchbeck, Spalding,Lincolnshire, PE11 3UL

Terms & Conditions Privacy Policy

© PSP People Systems Process Ltd. 2022. All Rights Reserved.

MENU

MENU

  • About

    • Blog

    • Business Process

    • Charity Work

    • History

    • News

  • Services

    • Legacy System Support

    • Bespoke System Development

    • Web Design & Development

    • View all services

  • Products

  • Our work

    • Customers

    • Case Studies

  • Careers

  • Contact

© PSP People Systems Process Ltd. 2022. All Rights Reserved. Privacy Policy

give us a call
01775 722377
drop us an email