Grid.Blazor
Grid.Blazor copied to clipboard
GetFormatedDateTime time type issue
I use GridBlazor 2.1.14 and get an issue from GetFormatedDateTime
because it try to convert a value that is already of type System.TimeSpan:
else if (type == "time")
textValue = string.Format("{0:HH:mm}", value);
The field is a time(3) in SqlServer, defined in the Model class as
[GridColumn(FilterEnabled = true, SortEnabled = true, Title = "TimeSpan")]
public TimeSpan? TimeSpan { get; set; }
and in ColumnCollection
as c.Add(o => o.TimeSpan).Titled("TimeSpan");
the UI presents a nice input:
but I needed to modify the code this way to have it working:
else if (type == "time")
textValue = value.ToString();
This is really a blocking issue for me, I cannot use a TimeSpan column because I get a "string format exception" when I try to view or edit a grid line containing this type.
Currently I must use a custom generated package :-(
Is there a way to override GridColumnBase.cs public string GetFormatedDateTime(object value, string type)
?