I have 2 dropdownlists: One for a Vertical Market & a 2nd dependent one for Vertical Market Subsegment. I'm trying to add feature where if there is only value in the 2nd list, it automatically selects that value. Is this possible? In my code below, if I initially select a Vertical Market with only 1 subsegment, it works correctly. But then if I select a different Vertical Market with more than one subsegment, I get the following error: Error: System.AggregateException: One or more errors occurred. (TypeError: Cannot read property 'removeChild' of null)
---> System.InvalidOperationException: TypeError: Cannot read property 'removeChild' of null
In my code:
void UpdateSubsegments(string val)
{
isVMSubsegmentEnabled = true;
subsegmentList = allSubsegments.Where(x => x.vertical_market == val).ToList();
if (subsegmentList.Count == 1)
{
projectParameters.VerticalMarketSubsegment = subsegmentList.Select(y => y.name).First();
}
else
{
projectParameters.VerticalMarketSubsegment = null;
}
}
private void VerticalMarketChanged(Syncfusion.EJ2.Blazor.DropDowns.ChangeEventArgs args)
{
UpdateSubsegments(args.Value);
}