Hello everyone!
Hoping someone can point me in the right direction.
I've built a basic blazor page that uses radzen data grid to display data from SQL server database.
The data is displayed and all is good, but I need to add filtering and sorting to it. Which I did, using the AllowFilter=true settings.
The option to sort and filter now shows up on the page, but I cant interact with it, I click it, and nothing happens. I cant select any dates, cant even click on 'sort'.
Its like the interactivity doesnt exist. Let alone filtering.
Heres what it looks like:
And heres the code on the page:
@page "/assessmentresults"
@using NotificationGUI.Web.Components.Interfaces
@using Radzen.Blazor
@using NotificationGUI.Web.Components.DataModel.Schemas.Calc
@using Microsoft.EntityFrameworkCore
@using System.Linq
@using Microsoft.AspNetCore.Mvc;
@using BlazorDownloadFile;
@attribute [StreamRendering]
@inject EMIRAssessmentResultsDbContext dbContext
<PageTitle>Assessment Results</PageTitle>
<h1>Assessment Results</h1>
<RadzenDataGrid TItem="EMIR_AssementResults" Data="@notificationData" AllowFiltering="true" AllowSorting="true" AllowColumnResize="true" FilterMode="Radzen.FilterMode.Simple" @ref="grid"
FilterCaseSensitivity="@filterCaseSensitivity" LogicalFilterOperator="Radzen.LogicalFilterOperator.Or" FilterPopupRenderMode="Radzen.PopupRenderMode.OnDemand">
<Columns>
<RadzenDataGridColumn TItem="EMIR_AssementResults" Property="AssessmentDateTime" Title="Assessment Date Time" MinWidth="200px" />
<RadzenDataGridColumn TItem="EMIR_AssementResults" Property="RBLKey" Title="RBL" MinWidth="50px"/>
<RadzenDataGridColumn TItem="EMIR_AssementResults" Property="AllThresholdsExceeded" Title="Notify NCA" MinWidth="100px" />
<RadzenDataGridColumn TItem="EMIR_AssementResults" Property="EntityResponsibleForReportingLEI" Title="Notify ERR" MinWidth="230px">
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="EMIR_AssementResults" Property="NumOfAffReports" Title="Num Of Aff Reports" MinWidth="150px" />
<RadzenDataGridColumn TItem="EMIR_AssementResults" Property="ThresholdConstantX" Title="Threshold Constant X" MinWidth="170px" />
<RadzenDataGridColumn TItem="EMIR_AssementResults" Property="ThersholdConstantY" Title="Threshold Constant Y" MinWidth="170px" />
<RadzenDataGridColumn TItem="EMIR_AssementResults" Property="AverageMontlyNum" Title="Average Montly Num" MinWidth="170px" />
<RadzenDataGridColumn TItem="EMIR_AssementResults" Property="NumOfAffReports_AverageMontlyNum" Title="Calculated percentage" MinWidth="180px" />
<RadzenDataGridColumn TItem="EMIR_AssementResults" Property="EntityResponsibleForReportingLEI" Title="ERRs" MinWidth="100px" />
</Columns>
</RadzenDataGrid>
@code {
List<EMIR_AssementResults> notificationData;
RadzenDataGrid<EMIR_AssementResults> grid;
Radzen.LogicalFilterOperator logicalFilterOperator = Radzen.LogicalFilterOperator.And;
Radzen.FilterCaseSensitivity filterCaseSensitivity = Radzen.FilterCaseSensitivity.CaseInsensitive;
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
// Retrieve data for RadzenDataGrid
notificationData = await dbContext.EMIR_AssessmentResultsData.ToListAsync();
}
}
Do I need to add more functionality somewhere for the filtering to work? I thought it was built-in, meaning we only need to declare the filter=true and thats it?