Current code :
@using Infrastructure.ViewModels
@using ERM.Common.Util;
@using static ComponentLibrary.Model.PageStatus
@inject IUnitOfWork UnitOfWork
<h5>This Months @ReportTitle Activity</h5>
<br />
<RadzenDataGrid @ref="grid"
IsLoading=@_isLoading
AllowPaging="true"
AllowSorting="true"
Data="@ReportData"
style="height: 335px"
LoadData="@LoadData"
PagerHorizontalAlign="HorizontalAlign.Center"
TItem="ActivityReportViewModel">
<RadzenDataGridColumn TItem="ActivityReportViewModel" Title="Institution Name" Property="InstitutionName" />
<RadzenDataGridColumn TItem="ActivityReportViewModel" Title="State" Property="StateName" />
<RadzenDataGridColumn TItem="ActivityReportViewModel" Title="Sales Rep" Property="SalesRep" />
<RadzenDataGridColumn TItem="ActivityReportViewModel" Title="Date Created" Property="CDate">
<Template Context="data">
@DisplayFormatting.FormatDateString(data.CDate)
</Template>
</RadzenDataGridColumn>
</RadzenDataGrid>
@code {
RadzenDataGrid<ActivityReportViewModel> grid;
[Parameter]
public int? ReportType { get; set; }
[Parameter]
public int? StateId { get; set; }
public string ReportTitle { get; set; }
private Status _status { get; set; }
bool _isLoading { get; set; } = false;
private IEnumerable<ActivityReportViewModel> ReportData { get; set; }
//protected override async Task OnInitializedAsync()
//{
// await LoadData();
//}
private async Task LoadData()
{
ReportData = new List<ActivityReportViewModel>();
_isLoading = true;
//await Task.Yield();
switch (ReportType)
{
case 1:
ReportData = await UnitOfWork.Proposal.ReportActivity(StateId);
ReportTitle = "Proposal";
break;
case 2:
ReportData = await UnitOfWork.Touch.ReportActivity(StateId);
ReportTitle = "Touch";
break;
case 3:
ReportData = await UnitOfWork.Prospects.ReportActivity(StateId);
ReportTitle = "Prospects";
break;
default:
break;
}
_isLoading = false;
await InvokeAsync(StateHasChanged);
}
}
When debugging for Proposal ReportData show 54 records loaded as page is rerender by await InvokeAsync(StateHasChanged);
Keep getting this page
I'm at a loss as I've used these RadzenDataGrid several times and have never ran into this type of issue.
Any suggestion would be appreciated