Skip to content

Commit

Permalink
DropDownDataGrid Cannot read properties of undefined (reading 'classL…
Browse files Browse the repository at this point in the history
…ist') error fixed
  • Loading branch information
enchev committed Aug 30, 2024
1 parent 75af217 commit 6ef443d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Radzen.Blazor/RadzenDropDownDataGrid.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,11 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
if (!Multiple && grid != null && SelectedItem != null)
{
var items = (LoadData.HasDelegate ? Data != null ? Data : Enumerable.Empty<object>() : (pagedData != null ? pagedData : Enumerable.Empty<object>())).OfType<object>().ToList();
selectedIndex = items.IndexOf(SelectedItem);
await JSRuntime.InvokeAsync<int[]>("Radzen.focusTableRow", grid.GridId(), "ArrowDown", selectedIndex - 1, null);
if (items.Any())
{
selectedIndex = items.IndexOf(SelectedItem);
await JSRuntime.InvokeAsync<int[]>("Radzen.focusTableRow", grid.GridId(), "ArrowDown", selectedIndex - 1, null);
}
}
}

Expand Down

0 comments on commit 6ef443d

Please sign in to comment.