- ABP Framework version: v8.0.3
- UI Type: Blazor Server
- Database System: EF Core (SQL Server)
- Tiered (for MVC) or Auth Server Separated (for Angular): NO
- Exception message and full stack trace:
System.AggregateException: One or more errors occurred. (Cannot detect the member of SITO.Countries.CountryDto (Parameter 'WorldRegion?'))
---> System.ArgumentException: Cannot detect the member of SITO.Countries.CountryDto (Parameter 'WorldRegion?')
at Blazorise.DataGrid.Utils.FunctionCompiler.GetSafePropertyOrField(Expression item, String propertyOrFieldName)
at Blazorise.DataGrid.Utils.FunctionCompiler.CreateValueGetter[TItem](String fieldName)
at Blazorise.DataGrid.DataGridColumn1.<.ctor>b__10_2() at System.Lazy
1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy
1.CreateValue()
at Blazorise.DataGrid.DataGridColumn1.GetValue(TItem item) at Blazorise.DataGrid._BaseDataGridRow
1.OnAfterRenderAsync(Boolean firstRender)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.NotifyRenderCompletedAsync()
--- End of inner exception stack trace ---
- Steps to reproduce the issue:
This is happening with all grids that bind to an enum. The data loads and renders correctly, then I get a client error along with the above Stack Trace:
if (!t)
throw new Error(`No interop methods are registered for renderer ${e}`);
return t
}
Also for more information here is the CountryDto:
namespace SITO.Countries { public abstract class CountryDtoBase : FullAuditedEntityDto<Guid> { public string? Name { get; set; } public string? Currency { get; set; } public string? ISOCode { get; set; } public int PhoneCountryCode { get; set; } public WorldRegion? WorldRegion { get; set; } public bool IsPublished { get; set; }
}
}
I have already generated code with ABPSuite for this entire data model, with maybe 10 affected entities. Need to find a fix for this ASAP so we can move forward.
Thanks,
Karim
7 Answer(s)
-
0
hi
Can you share a simple project to reproduce? liming.ma@volosoft.com
Thanks. -
0
-
0
This is still throwing the same error, screenshot below. I didn't change any code, just generated straight from ABP Suite, exactly as discussed. Added a Country as shown, with Asia selected, and getting the same error message.
I have tested this in Chrome, Firefox, Edge, Brave browsers, all the same error.
The DataGrid field is generated as nullable right from ABP Suite:
<DataGridColumn TItem="CountryDto" Field="PhoneCountryCode" Caption="@L["PhoneCountryCode"]"> </DataGridColumn> <DataGridColumn TItem="CountryDto" Field="WorldRegion?" Caption="@L["WorldRegion"]"> <DisplayTemplate> @L[$"Enum:WorldRegion.{context.WorldRegion?.ToString("d")}"] </DisplayTemplate> </DataGridColumn>
-
0
hi
Please change the
Field="WorldRegion?"
toField="WorldRegion"
We will update the suite code.
-
0
OK so yes Non Nullable Enums work with the Blazorise Grid. I tried changing the Enum to Non Nullable but when I regenerated with ABPSuite it gave me some bad code, maybe you can take a look at this also ( screenshot below ). So updating to Non Nullable isn't an option for me.
Removing the Nullable Enum field from the DataGrid is the workaround for now. Please let me know when you think this issue can / will be fixed so that I can plan accordingly.
Also since this is a bug can you please credit me back this support ticket?
Thanks,
Karim
-
0
Changing the
Field="WorldRegion?"
toField="WorldRegion"
, should be a quick workaround in your case. You don't need to set it as non-nullable in the ABP Suite UI and re-generate the entity again. We will fix this bug in the upcoming version, thanks for reporting.Also since this is a bug can you please credit me back this support ticket?
I have refunded your ticket. Best regards.
-
0
OK perfect, thanks.