Exception is thrown when GridForeignColumn is added to razor page. Please advice. Thank you.
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Syncfusion.Blazor
StackTrace:
at Syncfusion.Blazor.Grids.Internal.ForeignKey`1.<>c__DisplayClass6_0.<GenerateQuery>b__1(Object res)
Razor Page
<SfGrid TValue="Customer" >
<SfDataManager
Url="@Url"
InsertUrl="@($"{Url}/Insert")"
UpdateUrl="@($"{Url}/Update")"
RemoveUrl="@($"{Url}/Remove")"
Adaptor="Adaptors.UrlAdaptor"></SfDataManager>
<GridEditSettings Mode="EditMode.Dialog"
AllowAdding="true"
AllowDeleting="true"
AllowEditing="true"
AllowEditOnDblClick="false"
ShowDeleteConfirmDialog="true" />
<GridColumns>
<GridColumn Field="Id" HeaderText="Id" IsPrimaryKey="true" IsIdentity="true" Visible="false" ShowInColumnChooser="false" />
<GridColumn Field="RowVersion" Visible="false" ShowInColumnChooser="false" />
<GridForeignColumn Field="Email.EmailTypeId"
ForeignKeyField="Id" ForeignKeyValue="Text" TValue="EmailType">
<Syncfusion.Blazor.Data.SfDataManager Url="/api/EmailType" Adaptor="Adaptors.UrlAdaptor"></Syncfusion.Blazor.Data.SfDataManager>
</GridForeignColumn>
<GridColumn Field="Email.Text" Type="ColumnType.String" />
</GridColumns>
</SfGrid>
Email.cs
[Owned]
public class Email
{
[Display(Name = "EmailType", ResourceType = typeof(Resources.DataAnnotation.Shared.Email))]
[Required(ErrorMessageResourceName = "RequiredError", ErrorMessageResourceType = typeof(Resources.DataAnnotation.Shared.Email))]
public int? EmailTypeId { get; set; }
public virtual EmailType EmailType { get; set; }
[Display(Name = "Text", ResourceType = typeof(Resources.DataAnnotation.Shared.Email))]
[Required(ErrorMessageResourceName = "RequiredError", ErrorMessageResourceType = typeof(Resources.DataAnnotation.Shared.Email))]
[EmailAddress(ErrorMessageResourceName = "EmailError", ErrorMessageResourceType = typeof(Resources.DataAnnotation.Shared.Email))]
public string Text { get; set; }
}
Customer.cs
public class Customer : AbstractEntity
{
/// <summary>
/// Email
/// </summary>
[Display(Name = "Email", ResourceType = typeof(Resources.DataAnnotation.Customer))]
[Required(ErrorMessageResourceName = "RequiredError", ErrorMessageResourceType = typeof(Resources.DataAnnotation.Customer))]
public Email Email { get; set; }
}