I am attempting to format a datetime value to "HH:mm:ss" using the ToString method on a child data grid. As shown below, the Setup Time and Time Per Part columns are displaying the full datetime.
The current template for those columns are ${data.ProductionTime?.SetupTime} and ${data.ProductionTime?.TimePerPart} respectively with no 'FormatString' options available as shown below.
When I alter the template to read ${data.ProductionTime?.SetupTime.ToString("HH:mm:ss")} I receive the following error: "Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type".
I have used the ToString on the same column in a dropdown data grid successfully that read ${data.SetupTime.ToString("HH:mm:ss")}. The only difference I know of in that scenario is that I did not have to reference an expanded table.
What am I doing wrong? Please let me know if you require additional information, screenshots, or files.
I am having a similar issue on the Edit Page of the same table. I would like the Text Property to display the datetime as "HH:mm:ss" rather than the full datetime as well. Here is the generated format that displays the full datetime.
This gives me the error "error CS1501: No overload for method 'ToString' takes 1 arguments [C:\dev\BlazorProductionTime\server\ProductionTimeTracker.csproj]
dotnet: C:\dev\BlazorProductionTime\server\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Pages_EditPartRouting_razor.g.cs(117,174): error CS1662: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type [C:\dev\BlazorProductionTime\server\ProductionTimeTracker.csproj]"
I also receive errors when I edit the text property to read either:
As we already discussed there is no ToString() with format. You cannot also use such expressions for TextProperty - this is a string property name. You should define Template.