diff --git a/framework/src/Volo.Abp.MudBlazorUI/Components/AbpMudExtensibleDataGrid.razor b/framework/src/Volo.Abp.MudBlazorUI/Components/AbpMudExtensibleDataGrid.razor
index b656a551f9..2324311c46 100644
--- a/framework/src/Volo.Abp.MudBlazorUI/Components/AbpMudExtensibleDataGrid.razor
+++ b/framework/src/Volo.Abp.MudBlazorUI/Components/AbpMudExtensibleDataGrid.razor
@@ -2,141 +2,283 @@
@using MudBlazor
@using Volo.Abp.Data
-
-
-
-
-
-
- @UiLocalizer["NoDataAvailableInDatatable"]
-
-
-
- @if (Columns != null)
- {
- @foreach (var column in Columns)
+@if (ServerData is not null)
+{
+
+
+
+
+
+
+ @UiLocalizer["NoDataAvailableInDatatable"]
+
+
+
+ @if (Columns != null)
{
- if (column.Actions.Any())
+ @foreach (var column in Columns)
{
- var entityActionType = column.Actions.Count == 1 ? MudActionType.Button : MudActionType.Dropdown;
-
-
-
- @foreach (var action in column.Actions)
- {
- if (action.ConfirmationMessage != null)
- {
-
-
- }
- else
- {
-
-
- }
- }
-
-
-
- }
- else
- {
- @if (column.Component != null)
+ if (column.Actions.Any())
{
-
+ var entityActionType = column.Actions.Count == 1 ? MudActionType.Button : MudActionType.Dropdown;
+
- @RenderCustomTableColumnComponent(column.Component, context.Item!)
+
+ @foreach (var action in column.Actions)
+ {
+ if (action.ConfirmationMessage != null)
+ {
+
+
+ }
+ else
+ {
+
+
+ }
+ }
+
}
else
{
- if (!ExtensionPropertiesRegex.IsMatch(column.Data))
+ @if (column.Component != null)
+ {
+
+
+ @RenderCustomTableColumnComponent(column.Component, context.Item!)
+
+
+ }
+ else
{
- @if (column.ValueConverter == null)
+ if (!ExtensionPropertiesRegex.IsMatch(column.Data))
{
-
+ @if (column.ValueConverter == null)
+ {
+
+ }
+ else
+ {
+
+
+ @((MarkupString)GetConvertedFieldValue(context.Item, column))
+
+
+ }
}
else
{
-
+
- @((MarkupString)GetConvertedFieldValue(context.Item, column))
-
-
- }
- }
- else
- {
-
-
- @{
- var entity = context.Item as IHasExtraProperties;
- var propertyName = ExtensionPropertiesRegex.Match(column.Data).Groups[1].Value;
- var propertyValue = entity?.GetProperty(propertyName);
- if (propertyValue != null && propertyValue.GetType() == typeof(bool))
- {
- if ((bool)propertyValue)
+ @{
+ var entity = context.Item as IHasExtraProperties;
+ var propertyName = ExtensionPropertiesRegex.Match(column.Data).Groups[1].Value;
+ var propertyValue = entity?.GetProperty(propertyName);
+ if (propertyValue != null && propertyValue.GetType() == typeof(bool))
{
-
+ if ((bool)propertyValue)
+ {
+
+ }
+ else
+ {
+
+ }
}
else
{
-
+ if (column.ValueConverter != null)
+ {
+ @((MarkupString)GetConvertedFieldValue(context.Item, column))
+ }
+ else
+ {
+ if (column.DisplayFormat == null)
+ {
+ @(propertyValue)
+ }
+ else
+ {
+ @(string.Format(column.DisplayFormatProvider, column.DisplayFormat, propertyValue))
+ }
+ }
}
}
+
+
+ }
+ }
+ }
+ }
+ }
+
+
+ @if (ShowPager)
+ {
+
+ }
+
+
+}
+else
+{
+
+
+
+
+
+
+ @UiLocalizer["NoDataAvailableInDatatable"]
+
+
+
+ @if (Columns != null)
+ {
+ @foreach (var column in Columns)
+ {
+ if (column.Actions.Any())
+ {
+ var entityActionType = column.Actions.Count == 1 ? MudActionType.Button : MudActionType.Dropdown;
+
+
+
+ @foreach (var action in column.Actions)
+ {
+ if (action.ConfirmationMessage != null)
+ {
+
+
+ }
else
{
- if (column.ValueConverter != null)
+
+
+ }
+ }
+
+
+
+ }
+ else
+ {
+ @if (column.Component != null)
+ {
+
+
+ @RenderCustomTableColumnComponent(column.Component, context.Item!)
+
+
+ }
+ else
+ {
+ if (!ExtensionPropertiesRegex.IsMatch(column.Data))
+ {
+ @if (column.ValueConverter == null)
+ {
+
+ }
+ else
+ {
+
+
+ @((MarkupString)GetConvertedFieldValue(context.Item, column))
+
+
+ }
+ }
+ else
+ {
+
+
+ @{
+ var entity = context.Item as IHasExtraProperties;
+ var propertyName = ExtensionPropertiesRegex.Match(column.Data).Groups[1].Value;
+ var propertyValue = entity?.GetProperty(propertyName);
+ if (propertyValue != null && propertyValue.GetType() == typeof(bool))
{
- @((MarkupString)GetConvertedFieldValue(context.Item, column))
+ if ((bool)propertyValue)
+ {
+
+ }
+ else
+ {
+
+ }
}
else
{
- if (column.DisplayFormat == null)
+ if (column.ValueConverter != null)
{
- @(propertyValue)
+ @((MarkupString)GetConvertedFieldValue(context.Item, column))
}
else
{
- @(string.Format(column.DisplayFormatProvider, column.DisplayFormat, propertyValue))
+ if (column.DisplayFormat == null)
+ {
+ @(propertyValue)
+ }
+ else
+ {
+ @(string.Format(column.DisplayFormatProvider, column.DisplayFormat, propertyValue))
+ }
}
}
}
- }
-
-
+
+
+ }
}
}
}
}
- }
-
-
- @if (ShowPager)
- {
-
- }
-
-
+
+
+ @if (ShowPager)
+ {
+
+ }
+
+
+}
\ No newline at end of file
diff --git a/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor b/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor
index 96932a8f23..92eeb8854b 100644
--- a/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor
+++ b/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor
@@ -3,31 +3,30 @@
@if (Visible && HasPermission)
{
- if (ParentActions.Type == MudActionType.Dropdown)
+ if (ParentActions != null)
{
- if (Primary == false)
+ if (ParentActions.Type == MudActionType.Dropdown)
{
-
+ if (Primary == false)
+ {
+
+ @if (!string.IsNullOrEmpty(Icon))
+ {
+
+ }
+ @Text
+
+ }
+ }
+ else
+ {
+
@if (!string.IsNullOrEmpty(Icon))
{
-
+
}
@Text
-
+
}
}
- else
- {
-
- @if (!string.IsNullOrEmpty(Icon))
- {
-
- }
- @Text
-
- }
}
diff --git a/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor.cs b/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor.cs
index 4f6b5b404c..ffb1d4c0ba 100644
--- a/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor.cs
+++ b/framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor.cs
@@ -40,7 +40,7 @@ public partial class MudEntityAction : ComponentBase
public string? Icon { get; set; }
[CascadingParameter]
- public MudEntityActions ParentActions { get; set; } = default!;
+ public MudEntityActions? ParentActions { get; set; } = default!;
[Inject]
protected IAuthorizationService AuthorizationService { get; set; } = default!;
@@ -60,7 +60,10 @@ public partial class MudEntityAction : ComponentBase
}
#pragma warning restore CS0618
- ParentActions.AddAction(this);
+ if (ParentActions != null)
+ {
+ ParentActions.AddAction(this);
+ }
}
protected internal virtual async Task ActionClickedAsync()