Hi
I am having problems getting the below code to work. To get it to work all I have to do if un-comment the highlighted text. It looks like a bug?
@page "/test"
@using Syncfusion.EJ2.Blazor.Lists
@using System.Collections.ObjectModel
@using Newtonsoft.Json
<button @onclick="AddNew">ADD NEW OBJECT</button>
<EjsListView DataSource="@addresses"
ModelType="@addressType"
CssClass="e-list-template">
<ListViewTemplates>
<Template>
<div class="e-list-wrapper">
<span class="e-list-content">@((context as PickUpPoint).Address)</span>
</div>
</Template>
</ListViewTemplates>
</EjsListView>
@code{
void AddNew()
{
addresses.Add(new PickUpPoint {Address = "an address" });
}
ObservableCollection<PickUpPoint> addresses = new ObservableCollection<PickUpPoint>();
PickUpPoint addressType = new PickUpPoint();
public class PickUpPoint
{
public string Address { get; set; } = string.Empty;
public double Lat { get; set; } = 0;
public double Lon { get; set; } = 0;
public string Coordinates { get { return $"{Lat.ToString()} {Lon.ToString()}"; }}
}
}