Rating component

HI
I am Getting the following error when using Rating component in Razden UI
The following code gets generated

code in *.razor.designer.cs

protected int Rating
{
get
{
return _Rating;
}
set
{
if(!object.Equals(_Rating, value))
{
_Rating = value;
InvokeAsync(() => { StateHasChanged(); });
}
}
}
protected async System.Threading.Tasks.Task Rating0Change(dynamic args)
{
Rating = args;
}

I get the following errors

dotnet: Pages\IssueBooks.razor(123,77): error CS0123: No overload for 'IssueBooksComponent.Rating0Change(dynamic)' matches delegate 'Func<int, Task>' [C:\Code\BookTrackV002\server\BookTrackV002.csproj]
obj\Debug\netcoreapp3.1\Razor\Pages\IssueBooks.razor.g.cs(441,175): 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:\Code\BookTrackV002\server\BookTrackV002.csproj]

dotnet: Pages\IssueBooks.razor(123,77): error CS0123: No overload for 'IssueBooksComponent.Rating0Change(dynamic)' matches delegate 'Func<int, Task>' [C:\Code\BookTrackV002\server\BookTrackV002.csproj]
obj\Debug\netcoreapp3.1\Razor\Pages\IssueBooks.razor.g.cs(441,175): 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:\Code\BookTrackV002\server\BookTrackV002.csproj]

Thanks for the report @bhenning! It will be fixed with the next update - in the meantime please use binding instead Change:


Hello,
I am facing the same issue. But if this is the workaround, how will the value be saved in database?
Thank you

The problem is already fixed.

Thank you.
I am using 2.46.0 and have the issue

Can you post a screenshot from the Change handler?

Sorry,
It was a datatype problem. The database column was nullable and seems the rating didn't accept this.
I dont have the need to use the change event. just bind the rating control to database.
Thank you

But by the way, is there a way for the "stars" to be displayed inside a datagrid column instead of number ?

Of course. You just need to place the Rating component in the column Template and bind the value :