Hi
Currently, I'm using the following code to display data with initial grouping:
...
.DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("Method", "Controller")) .ServerOperation(false) .GroupPaging(true) .PageSize(50) .Group(g => { g.Add(x => x.JahrText); g.Add(x => x.QuartalText); g.Add(x => x.MonatText); g.Add(x => x.TagText); } ) .Aggregates(aggr => { aggr.Add(e => e.JahrText).Count(); aggr.Add(e => e.QuartalText).Count(); aggr.Add(e => e.MonatText).Count(); aggr.Add(e => e.TagText).Count(); aggr.Add(e => e.Description).Count(); })...
Now I'd like to do the initial grouping (when the page gets rendered for the first time) based on a value in the model.
Let's say, if the model property "GroupLevel" is set to 1, only the "JahrText" is added to the group.
If the property "GroupLevel" is set to 2, "JahrText" and "QuartalText" are added to the group, etc.
Is there an easy way to implement such a behaviour?
Thank you for your support!
Best regards,Daniel