C1FlexGrid: Filtering a grouped grid does not change aggregations

Posted by: rafael.riveratorres on 17 November 2023, 1:52 am EST

  • Posted 17 November 2023, 1:52 am EST - Updated 17 November 2023, 1:57 am EST

    Hi,

    We have a grid with some groupings created by code, following:

    https://developer.mescius.com/componentone/docs/win/online-flexgrid/group.html

    It also has Sum Aggretations defined in some columns to show subtotals by group.

    We have an issue that if we apply a filter on the column, the rows shown in each node change but the subtotals of the group does not change. I would believe it is because the filtering is only making the rows invisible but are still considered in the Aggregations calculation.

    Is there a way to change this behaviour? Thanks

  • Posted 20 November 2023, 11:40 pm EST

    Hello Rafael,

    We are very sorry for the delayed response.

    To update the Aggregates after filtering, you can apply the GroupDescriptions again after the filtering by using the AfterFilter event of FlexGrid as follows:

    private void Grid_AfterFilter(object sender, EventArgs e)
    {
        _grid.GroupDescriptions = new List<GroupDescription>()
        {
            new GroupDescription("LastName"),
            new GroupDescription("ShipCountry")
        };
    }

    Note: While investigating the above solution, we encountered a behavior where the item count in the node row header might not be correct. We have escalated this behavior to the development team for further investigation and will inform you as soon as possible.

    Until then, as a workaround, you can remove the item count from your node row header as follows:

    _grid.GroupHeaderFormat = "{name}: {value}";

    Please refer to the attached sample for implementation. (see FlexGrid48_GroupFilter.zip).

    [Internal Tracking ID: C1WIN-31404]

    Best Regards,

    Kartik

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels