Rating Component Inside DataGrid

Hi,

I am trying to use the Rating component inside a RadzenDataGridColumn but I am getting the following errors:

CS0131 The left-hand side of an assignment must be a variable, property or indexer
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

I have tried a different Radzen component and it is working as expected.

This is the code:

        <RadzenDataGridColumn TItem="Atlas.Models.CyberIamAtlasDev.PersonSkill" Property="rating" Title="Rating">
          <Template Context="atlasModelsCyberIamAtlasDevPersonSkill">
            <RadzenNumeric @bind-Value="@(atlasModelsCyberIamAtlasDevPersonSkill.rating)" Name="Numeric0">
            </RadzenNumeric>
            <RadzenLabel Text="@($"{(atlasModelsCyberIamAtlasDevPersonSkill.rating)}")">
            </RadzenLabel>
            <RadzenRating @bind-Value="@(Convert.ToInt32(atlasModelsCyberIamAtlasDevPersonSkill.rating))" Name="Rating0">
            </RadzenRating>
          </Template>
        </RadzenDataGridColumn>

Any tips?

Thanks,

Andy

You cannot use such complex expression for @bind-Value.

That is not the issue.

When I change it to this:

            <RadzenRating @bind-Value="@(atlasModelsCyberIamAtlasDevPersonSkill.rating)" Name="Rating0">
            </RadzenRating>

as the model is a short and I get a different error with that:

cannot convert from 'Microsoft.AspNetCore.Components.EventCallback' to 'Microsoft.AspNetCore.Components.EventCallback'
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

So I was simply converting the short to an integer to not get this error.

Hey @cyber,

bind-Value is a two way binding expression and will attempt to set the value in both directions. You cannot set a value to a method.