TValue="string"
TItem="Supplier"
DataSource="@supplierList.supSupplierList"
OnSelect="@OnSelect"
@onchange="@OnChange">
Supplier ID: @Value
@Message
@code{
public string Message { get; set; } = "";
SupplierList supplierList = new SupplierList();
public string Value { get; set; } = null;
public void OnSupplierChange(Syncfusion.EJ2.Blazor.DropDowns.ChangeEventArgs eventArgs)
{
Message += "OnSupplierChange";
this.Value = eventArgs.Value;
this.StateHasChanged();
}
public void OnSelect()
{
Message += "OnSelect";
StateHasChanged();
}
public void OnChange()
{
Message += "OnChange";
StateHasChanged();
}
public class SupplierList
{
public List supSupplierList = new List
{
new Supplier { Name ="Paul Henriot", SID= 101 },
new Supplier { Name= "Karin Josephs", SID= 102 },
new Supplier { Name ="Mario Pontes", SID= 103 },
new Supplier { Name= "Mary Saveley", SID= 104 }
};
}
public class Supplier
{
public string Name { get; set; }
public int SID { get; set; }
}
}
```
Ultimately, I'd like to wrap the above into a (more specific DropDownList) component and allow parent components to be notified when the selection has changed.
I'm open to alternate ways of doing this and any best practices. Thanks.