Skip to content

DataGrid/PropertyColumn use DisplayAttribute value for enum but doesn't support nullable value #2345

@JarJasAskom

Description

@JarJasAskom

Feature from Fluent UI Blazor 4.9

[DataGrid] Make PropertyColumn use DisplayAttribute value for enum (#2304)

supports enum types but does not support nullable enum types. DataGrid works correctly for example data

public enum Positions
{
    employee,
    [Display(Name = "HR Manager (DA)")]
    HrManager,
    [Display(Name = "Project Manager (DA)")]
    ProjectManager,
    [Display(Name = "Administrator (DA)")]
    Administrator
}



public class Employee
{
    [Display(Name = "Id")]
    public int Id { get; set; }
    [Display(Name = "Position")]
    public Positions Position { get; set; }
}

but DataGrid/PropertyColumn does not recognize nullable enum property (Position? Positions) as enum and attribute Display is ignored.

public class Employee
{
    [Display(Name = "Id")]
    public int Id { get; set; }
    [Display(Name = "Position")]
    public Positions? Position { get; set; }
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions