From 7de5d90c8225e30f09945cd40d441c8a2c4cacc1 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Fri, 1 Nov 2024 19:43:45 +0200 Subject: [PATCH] DataGrid Reset() should reset to original columns order --- Radzen.Blazor/RadzenDataGrid.razor.cs | 1 + RadzenBlazorDemos/Pages/DataGridColumnReoder.razor | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Radzen.Blazor/RadzenDataGrid.razor.cs b/Radzen.Blazor/RadzenDataGrid.razor.cs index 18cb339290d..a43892eb2f6 100644 --- a/Radzen.Blazor/RadzenDataGrid.razor.cs +++ b/Radzen.Blazor/RadzenDataGrid.razor.cs @@ -2043,6 +2043,7 @@ public void Reset(bool resetColumnState = true, bool resetRowState = false) }); selectedColumns = allColumns.Where(c => c.Pickable && c.GetVisible()).ToList(); sorts.Clear(); + columns = allColumns.Where(c => c.Parent == null).ToList(); } } diff --git a/RadzenBlazorDemos/Pages/DataGridColumnReoder.razor b/RadzenBlazorDemos/Pages/DataGridColumnReoder.razor index 6ecd863a6a4..d6653ea0e96 100644 --- a/RadzenBlazorDemos/Pages/DataGridColumnReoder.razor +++ b/RadzenBlazorDemos/Pages/DataGridColumnReoder.razor @@ -4,8 +4,9 @@ @inherits DbContextPage - - + + @@ -34,7 +35,7 @@ @code { EventConsole console; - + RadzenDataGrid grid; IEnumerable employees; protected override async Task OnInitializedAsync()