Open dharmatech opened 3 years ago
Same question here, i want to group by default some columns. Is there a way to do this?
Bonus: i'd like to be able to group but without the possibility to change the default grouping for the user.
@dharmatech Did you find how to achieve this?
Thanks.
Has anyone found any information on grouping programatically? I've tried studying the code examples but I can't find anything that would explain how to group programatically. We don't want to use the drag and drop box, but rather want columns set to group during initialization/rendering. The only documentation seems to be calling the GroupAble() method on the Grid class, nothing about how individual columns are grouped.
Checkout OnAfterRenderAsync in ../GridBlazorStandalone/Pages/Groupable.razor
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
var payloads = new List
Example
Here's a grid where I've grouped by
Date
andTime
:The code I used in my Razor Pages page model to turn on grouping:
Question
I'd like to always group by
Date
andTime
, without the user having to drag the columns into the grouping field manually.Is there a way to group by certain columns programmatically?