Mewriick / Blazor.FlexGrid

GridView component for Blazor
MIT License
199 stars 36 forks source link

Add PropertyBuilder.HasValueFormatter defaultValue option #24

Closed hikarin522 closed 5 years ago

hikarin522 commented 5 years ago

Added option to allow null for PropertyBuilder.HasValueFormatter.

Example:

builder.Property(e => e.property)
    .HasValueFormatter(e => e != null ? e.ToString() : "Null", true);
Mewriick commented 5 years ago

If I get it right you want to render some default value in column when the source value is null? Maybe it would be better have instead paramter allowNull , parameter defaultValue. This parameter will be default String.Empty. Let me know what do you think about this solution?

hikarin522 commented 5 years ago

I fixed the parameter from allowNull to defaultValue. And, the problem that #25 was mixed was corrected.