Hi I have a problem with RadzenDropdown used in grid, during submit it's throwing this exception, but when I skip validation database is saving record properly. Any idea what I miss in Dropdown config to handle it properly in form?
System.InvalidOperationException: Cannot find component with Name at Radzen.Blazor.ValidatorBase.ValidateModel(Object sender, ValidationRequestedEventArgs args)
<RadzenDataGridColumn TItem="PayrollTemplateField" Property="PayrollComponent.Name" Title="Name">
<EditTemplate Context="row">
<RadzenDropDown @bind-Value=@row.PayrollComponent TValue="PayrollComponent" TextProperty="Name" Data="@_components" />
</EditTemplate>
</RadzenDataGridColumn>
Here is data model:
public class PayrollTemplate : CFEntity
{
public required string Name { get; set; }
public virtual ICollection<PayrollTemplateField> PayrollTemplateFields { get; set; } = [];
public bool IsActive { get; set; } = true;
}
public class PayrollTemplateField : CFEntity
{
[ForeignKey("PayrollTemplateId")]
public virtual PayrollTemplate PayrollTemplate { get; set; }
public Guid PayrollTemplateId { get; set; }
[ForeignKey("PayrollComponentId")]
public virtual PayrollComponent PayrollComponent { get; set; }
public Guid PayrollComponentId { get; set; }
public int Order { get; set; }
public PayrollSection PayrollSection { get; set; }
}
public class PayrollComponent : CFEntity
{
public string Name { get; set; } = "";
public PayrollComponentType Type { get; set; }
}