I'm experiencing a strange behaviour. When adding a RowSelect Event like shown in the samples, the DataGrid will be empty after the event fired, showing "No records to display".
Code is quite simple:
@page "/questionseditor"
@using AdministrationBackend.Models
@using Microsoft.EntityFrameworkCore
@inject ELearningContext db
<h2>Fragen-Editor</h2>
@if (questions == null)
{
<p><em>Lade...</em></p>
}
else
{
<RadzenGrid @ref="grid0" Count="@count" Data="@questions" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" Value="@selectedQuestion" AllowSorting="true" AllowFiltering="true" AllowPaging="true" PageSize="4" TItem="Question" RowSelect="@(args => selectedQuestion = args)">
<Columns>
<RadzenGridColumn TItem="Question" Property="Id" Title="ID" />
<RadzenGridColumn TItem="Question" Property="Question1" Title="Frage" />
</Columns>
</RadzenGrid>
}
@code {
int count;
Question selectedQuestion;
IQueryable<Question> questions;
protected override void OnInitialized()
{
questions = db.Question;
selectedQuestion = questions.FirstOrDefault();
}
}
Thank you for any hint!