diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index a4d0d8e72d0..e24c2502f0b 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@  - 10.6.2 + 10.6.3 diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.Edit.cs b/src/BootstrapBlazor/Components/Table/Table.razor.Edit.cs index 9216fbd4583..33a281ba220 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.Edit.cs +++ b/src/BootstrapBlazor/Components/Table/Table.razor.Edit.cs @@ -558,7 +558,8 @@ protected async Task QueryData(bool triggerByPagination = false, bool firstQuery var queryOption = BuildQueryPageOptions(firstQuery); queryOption.IsTriggerByPagination = triggerByPagination; - if (DynamicContext != null) + + if (OnQueryAsync == null && typeof(TItem).IsAssignableTo(typeof(IDynamicObject))) { QueryDynamicItems(queryOption, DynamicContext, isAutoQuery); } diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs b/src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs index 0a2aa60bc01..91ff894c37c 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs +++ b/src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs @@ -1237,26 +1237,29 @@ private void ResetDynamicContext() } } - private void QueryDynamicItems(QueryPageOptions queryOption, IDynamicObjectContext context, bool isAutoQuery = true) + private void QueryDynamicItems(QueryPageOptions queryOption, IDynamicObjectContext? context, bool isAutoQuery = true) { if (isAutoQuery) { _rowsCache = null; - var items = context.GetItems(); - if (context.OnFilterCallback != null) + if (context != null) { - items = context.OnFilterCallback(queryOption, items); - } - if (IsPagination) - { - TotalCount = items.Count(); - PageCount = (int)Math.Ceiling(TotalCount * 1.0 / Math.Max(1, _pageItems)); - PageIndex = GetSafePageIndex(); - items = items.Skip((PageIndex - 1) * _pageItems).Take(_pageItems); - } - QueryItems = items.Cast().ToList(); + var items = context.GetItems(); + if (context.OnFilterCallback != null) + { + items = context.OnFilterCallback(queryOption, items); + } + if (IsPagination) + { + TotalCount = items.Count(); + PageCount = (int)Math.Ceiling(TotalCount * 1.0 / Math.Max(1, _pageItems)); + PageIndex = GetSafePageIndex(); + items = items.Skip((PageIndex - 1) * _pageItems).Take(_pageItems); + } + QueryItems = items.Cast().ToList(); - ResetSelectedRows(QueryItems); + ResetSelectedRows(QueryItems); + } } }