Skip to content

Commit

Permalink
DropDownDataGrid should not request items on clear if not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
enchev committed Nov 20, 2024
1 parent e845df2 commit b9d9e96
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Radzen.Blazor/RadzenDropDownDataGrid.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,8 @@ async System.Threading.Tasks.Task Clear()
if (Disabled)
return;

var canRequest = searchText != null;

searchText = null;
internalValue = default(TValue);
selectedItem = null;
Expand All @@ -669,7 +671,12 @@ async System.Threading.Tasks.Task Clear()
await grid.SelectRow(null);
}

StateHasChanged();
if (canRequest)
{
await OnLoadData(new Radzen.LoadDataArgs() { Skip = 0, Top = PageSize, OrderBy = "" });
}

StateHasChanged();
}

string previousSearch;
Expand Down

0 comments on commit b9d9e96

Please sign in to comment.