1. Select country = China since it has more cities. 2. select a city: scroll to the last city to show skip value is not reset after dataSource has been changed.
3. Select country = USA (wait until data has been fully loaded), 4. select a city: the city dropdown is empty, in the debugger the skip value is not reset to 0
@code{
public string CountryString {get;set;}
public List Countries = new(){"China","United States of America"};
public TelerikDropDownList CountriesDDL { get; set; }
public TelerikDropDownList CitiesDDL { get; set; }
private async Task CountryOnChange(object value)
{
//reset cascading
Value = 0;
StateHasChanged();
if (value == null)
{
return;
}
var currentCountry = (string)value;
var AllAreas = await urbanAreaService.GetUrbanAreas();
var AllUrbanAreasInSelectedCounties = AllAreas.Where(x => x.Country == currentCountry);
UrbanAreas = AllUrbanAreasInSelectedCounties;
//how to reset skip and filtering on cityDropdown?
//CitiesDDL.Rebind(); //to call onRead
}
}
@code {
private UrbanAreaService _urbanAreaService;
private UrbanAreaService urbanAreaService
{
get
{
if(_urbanAreaService == null)
{
_urbanAreaService = new UrbanAreaService(http);
}
return _urbanAreaService;
}
}
public IEnumerable UrbanAreas { get; set; }
public int Value { get; set; }
protected override async Task OnInitializedAsync()
{
UrbanAreas = await urbanAreaService.GetUrbanAreas();
}
}