Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
Error:
blazor.server.js:1 [2023-12-28T17:23:18.113Z] Error: System.ArgumentNullException: Value cannot be null. (Parameter 'element')
at System.ArgumentNullException.Throw(String paramName)
at System.Attribute.GetCustomAttributes(MemberInfo element, Type attributeType, Boolean inherit)
at Syncfusion.Blazor.MetadataExtension.GetDisplayName(Enum enumValue)
at Syncfusion.Blazor.Grids.Internal.GridCellBase`1.GetValue()
at Syncfusion.Blazor.Grids.Internal.GridCellBase`1.OnParametersSetAsync()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
Replication steps:
@page "/s"
@using Syncfusion.Blazor.Grids
@using System.ComponentModel.DataAnnotations
<SfGrid @ref="Grid" DataSource="@dataSource" AllowSelection="true" Toolbar="@(new List<string>() {"Add", "Edit", "Delete", "Update", "Cancel"})">
<GridEditSettings AllowEditing="true" Mode="EditMode.Dialog"></GridEditSettings>
<GridColumns>
<GridColumn Field="@nameof(DataItem.Id)"></GridColumn>
<GridColumn Field="@nameof(DataItem.LineCategoryType)" HeaderText="Line Category" Visible="true" />
</GridColumns>
</SfGrid>
@code{
private SfGrid<DataItem> Grid;
public List<DataItem> dataSource = new List<DataItem>()
{
new DataItem { Id = 1, ParentId = 1, ChildId = 1 },
new DataItem { Id = 2, ParentId = 2, ChildId = 5, LineCategoryType = LineCategoryType.Basic }
};
public class DataItem
{
public int Id { get; set; }
public int? ParentId { get; set; }
public int? ChildId { get; set; }
public LineCategoryType LineCategoryType { get; set; }
}
protected override async Task OnInitializedAsync()
{
await Task.CompletedTask;
}
public enum LineCategoryType
{
[Display(Name = "Basic")]
Basic = 1,
[Display(Name = "Trading")]
Trading = 2,
[Display(Name = "Accommodation")]
Accommodation = 3,
[Display(Name = "Opportunistic")]
Opportunistic = 4,
[Display(Name = "Non Renewable")]
NonRenewable = 5
}
}