I am trying to create a reusable component which binds to a data service where I pass the binded value to the parent and get the data from the Telerik Drop List / Combo box, etc. What am I missing in regards to getting this data back up the the parent model? When I submit, it provides a value of null. #StillLearning
Code example concept:
Razor:
@inherits ActiveProviderTypeDropDownListBase
<TelerikComboBox Data="@ProviderTypes"
OnRead="@OnReadAsync"
TValue="string"
TItem="string"
AllowCustom="true"
@bind-Value="@BindValue"
Width="100%" />
Base:
public class ActiveProviderTypeDropDownListBase : ComponentBase
{
[Inject] ProviderDataService ProviderDataService { get; set; }
[Parameter] public string Width { get; set; }
[Parameter] public string BindValue { get;set; }
public List<string> ProviderTypes { get; set; }
public async Task OnReadAsync()
{
ProviderTypes = await ProviderDataService.GetActiveProviderTypesAsync();
}
}
Reusable Component For Elsewhere Elsewhere:
<ActiveProviderTypeDropDownList Width="100%"
BindValue="DialogBaseService.ValueToCreate.ProviderTypeName"