+ @if (Virtualize || CurrentPageItems.Count() > 0)
{
-
- @{ var groupClass = new CssBuilder(GroupClass).AddClass(GroupClassFunc?.Invoke(g)).Build(); }
- @{ var groupStyle = new StyleBuilder().AddStyle(GroupStyle).AddStyle(GroupStyleFunc?.Invoke(g)).Build(); }
-
-
-
-
- @if (GroupedColumn.GroupTemplate == null)
- {
- @GroupedColumn.Title: @g.Grouping.Key
- }
- else
- {
- @GroupedColumn.GroupTemplate(@g)
- }
- |
-
-
- @if (g.Expanded)
+ if (IsGrouped)
{
-
-
- @if (RowLoadingContent != null)
- {
- @RowLoadingContent
- }
- else
- {
-
-
- @Localizer[LanguageResource.MudDataGrid_Loading]
- |
-
- }
-
-
-
- @{ var rowClass = new CssBuilder(RowClass).AddClass(RowClassFunc?.Invoke(itemBag.Item, itemBag.Index)).Build(); }
- @{ var rowStyle = new StyleBuilder().AddStyle(RowStyle).AddStyle(RowStyleFunc?.Invoke(itemBag.Item, itemBag.Index)).Build(); }
- OnRowClickedAsync(args, itemBag.Item, itemBag.Index))"
- @oncontextmenu="@((args) => OnContextMenuClickedAsync(args, itemBag.Item, itemBag.Index))"
- @oncontextmenu:preventDefault="@(RowContextMenuClick.HasDelegate)">
-
- @foreach (var column in RenderedColumns)
- {
- if (!column.HiddenState.Value)
- {
- @Cell(column, itemBag.Item)
- }
- }
-
-
- @if (ChildRowContent != null && (_openHierarchies.Contains(itemBag.Item) || !HasHierarchyColumn))
- {
-
-
- @ChildRowContent(new CellContext(this, itemBag.Item))
- |
-
- }
-
-
-
-
-
- @NoRecordsContent
-
- |
-
-
-
- @*Group Footer*@
-
- @FooterCells(g.Grouping.ToList())
-
- }
- }
- }
- else
- {
-
-
- @if (RowLoadingContent != null)
+ var groupItemsPage = GroupItemsPage;
+ var groupDefinitions = GetGroupDefinitions(_groupDefinition, groupItemsPage);
+ if (!groupItemsPage.Any())
{
- @RowLoadingContent
+
+
+
+ @NoRecordsContent
+
+ |
+
}
- else
+ foreach (var g in groupDefinitions)
{
-
-
- @Localizer[LanguageResource.MudDataGrid_Loading]
- |
-
+
}
-
-
-
- @{ var rowClass = new CssBuilder(RowClass).AddClass(RowClassFunc?.Invoke(itemBag.Item, itemBag.Index)).Build(); }
- @{ var rowStyle = new StyleBuilder().AddStyle(RowStyle).AddStyle(RowStyleFunc?.Invoke(itemBag.Item, itemBag.Index)).Build(); }
- OnRowClickedAsync(args, itemBag.Item, itemBag.Index))"
- @oncontextmenu="@((args) => OnContextMenuClickedAsync(args, itemBag.Item, itemBag.Index))"
- @oncontextmenu:preventDefault="@(RowContextMenuClick.HasDelegate ? true : false)">
-
- @foreach (var column in RenderedColumns)
+ }
+ else
+ {
+
+ }
+ }
+ else if (Loading ? LoadingContent != null : NoRecordsContent != null)
+ {
+
+
+
+ @if (Loading)
{
- if (!column.HiddenState.Value)
- {
- @Cell(column, itemBag.Item)
- }
+ @LoadingContent
}
-
- |
- @if (ChildRowContent != null && (_openHierarchies.Contains(itemBag.Item) || !HasHierarchyColumn))
- {
-
-
- @ChildRowContent(new CellContext(this, itemBag.Item))
- |
-
- }
-
-
-
-
-
+ else
+ {
@NoRecordsContent
-
- |
-
-
-
- }
- }
- else if (Loading ? LoadingContent != null : NoRecordsContent != null)
- {
-
-
-
- @if (Loading)
- {
- @LoadingContent
- }
- else
- {
- @NoRecordsContent
- }
-
- |
-
- }
-
-
-