diff --git a/samples/Sample.Core/Pages/DataGrid/Examples/Banks.razor b/samples/Sample.Core/Pages/DataGrid/Examples/Banks.razor
index 2225174..cc3f92c 100644
--- a/samples/Sample.Core/Pages/DataGrid/Examples/Banks.razor
+++ b/samples/Sample.Core/Pages/DataGrid/Examples/Banks.razor
@@ -5,6 +5,8 @@
Banks
+
+
diff --git a/src/LoreSoft.Blazor.Controls/Data/DataComponentBase.cs b/src/LoreSoft.Blazor.Controls/Data/DataComponentBase.cs
index 3e2452c..8692043 100644
--- a/src/LoreSoft.Blazor.Controls/Data/DataComponentBase.cs
+++ b/src/LoreSoft.Blazor.Controls/Data/DataComponentBase.cs
@@ -67,12 +67,16 @@ public bool IsLoading
protected Exception DataError { get; private set; }
- public virtual async Task RefreshAsync(bool resetPager = false)
+ public virtual async Task RefreshAsync(bool resetPager = false, bool forceReload = false)
{
// reset page
if (resetPager)
Pager.Reset();
+ // clear cached data to force data loader to re-run
+ if (forceReload && DataLoader != null)
+ _data = null;
+
await RefreshCoreAsync();
}
diff --git a/src/LoreSoft.Blazor.Controls/Data/DataGrid.razor.cs b/src/LoreSoft.Blazor.Controls/Data/DataGrid.razor.cs
index 1d86de3..3bfb5c5 100644
--- a/src/LoreSoft.Blazor.Controls/Data/DataGrid.razor.cs
+++ b/src/LoreSoft.Blazor.Controls/Data/DataGrid.razor.cs
@@ -138,13 +138,13 @@ public async Task ApplyFilters(IEnumerable rules, bool replace = fals
}
- public override async Task RefreshAsync(bool resetPager = false)
+ public override async Task RefreshAsync(bool resetPager = false, bool forceReload = false)
{
// clear row flags on refresh
_expandedItems.Clear();
SetSelectedItems(new List());
- await base.RefreshAsync(resetPager);
+ await base.RefreshAsync(resetPager, forceReload);
}