Posted 16 June 2023, 4:55 pm EST
I notice that your sample only groups by one column. Is it possible to group by multiple columns?
Forums Home / ComponentOne / Blazor Edition
Posted by: andy.richard on 16 June 2023, 4:55 pm EST
Posted 16 June 2023, 4:55 pm EST
I notice that your sample only groups by one column. Is it possible to group by multiple columns?
Posted 20 June 2023, 8:43 am EST - Updated 20 June 2023, 8:48 am EST
Hi Andy,
Yes, you could group the multiple columns in FlexGrid. The GroupAsync method takes array of GroupDescription that you could use to group multiple columns. Kindly refer to the following code snippet and the attached sample:
protected override async Task OnInitializedAsync()
{
forecasts = await ForecastService.GetForecastAsync(DateTime.Now);
var dataCollection = new C1DataCollection<WeatherForecast>(forecasts);
await dataCollection.GroupAsync(new GroupDescription("Summary"),
new GroupDescription("Date"));
forecastsDataCollection = dataCollection;
}
References:
GroupDescription Class: https://www.grapecity.com/componentone/docs/blazor/online-blazor/C1.DataCollection~C1.DataCollection.GroupDescription.html
GroupAsync method: https://www.grapecity.com/componentone/docs/blazor/online-blazor/C1.DataCollection~C1.DataCollection.C1DataCollection`1~GroupAsync.html
Regards,
Ankit
Sample: