Skip to content

Fix wrong group count if GroupInterval is specified - #737

Merged
JaleChaki merged 3 commits into
masterfrom
T1334349
Sep 1, 2026
Merged

Fix wrong group count if GroupInterval is specified#737
JaleChaki merged 3 commits into
masterfrom
T1334349

Conversation

@JaleChaki

Copy link
Copy Markdown
Contributor

Bug

DataSourceLoader returns an incorrect group count if the GroupInterval is specified. The code snippet below demonstrates how to reproduce the bug.

var loadResult = await DataSourceLoader.LoadAsync(dbContext.SomeDbSet, new LoadOptions() {
    Group = [
        new GroupingInfo {
            Selector = "DateTimeField",
            GroupInterval = "year",
            IsExpanded = false
        }
    ],
    RemoteGrouping = true, // required
    RequireGroupCount = true,
    Skip = 1 // required
});

// expected: number of group intervals
// actual: number of unique "DateTimeField" values
Console.WriteLine(loadResult.groupCount); 

Fix

The DataSourceExpressionBuilder.BuildGroupCountExpr() method now checks the grouping interval. If a grouping interval is defined, it uses remote grouping expression mechanism instead of SelectCompiler

@JaleChaki JaleChaki added bug .NET Pull requests that update .net code labels Aug 31, 2026
@JaleChaki JaleChaki changed the title Fix wrong group count if GroupInterval is specified Draft: Fix wrong group count if GroupInterval is specified Aug 31, 2026
@JaleChaki
JaleChaki marked this pull request as draft August 31, 2026 13:35
@JaleChaki
JaleChaki marked this pull request as ready for review September 1, 2026 08:15
@JaleChaki JaleChaki changed the title Draft: Fix wrong group count if GroupInterval is specified Fix wrong group count if GroupInterval is specified Sep 1, 2026
Comment thread net/DevExtreme.AspNet.Data/DataSourceExpressionBuilder.cs Outdated
@JaleChaki
JaleChaki merged commit 97e6e14 into master Sep 1, 2026
17 checks passed
@JaleChaki
JaleChaki deleted the T1334349 branch September 1, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug .NET Pull requests that update .net code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants