is there any way to change the multiselect values from code after render? The selection never picks up the changes in the connected bound value (a List or IEnumerable in this case).
Maybe through jsinterop? Could I just call the same function (which one is it?) that you trigger when selecting a checkbox in the selection popup?
Ok this is really weird. The components do notice when I add an item to the bound List (and check the box accordingly), but when I remove an item, they do not uncheck anything. Is this a bug?
This really is very weird. In a simple test app everything works as expected, but moving the same page to my project selections are only ever added, but never removed. Something odd is happening...
Edit: ....And now it's suddenly working. Wtf? I guess this is one of those things...
I am facing same issue with multi select dropdown.
I am selecting a item in dropdown and then by button click want to reset dropdown value by removing selected item and selecting other item using code behind , values are setting properly but in UI is still showing both selections and is not removing the one which I did from code behind
please advise if any workaround for this.
I am doing same as u mentioned and property value is setting properly but still in UI showing the d selection as well as new one even though property valueIEnumerable is having only 1 item ehile debuging.
How to avoid seeing old value in UI.
![function to set dropdown|436x500, 100%]
protected void BindModelValue(string control)
{
case "region":
region = !region;
userAccessModel.AccessLevel = 1;
if (region)
{
loc = false;
mc = false;
CurrentUserAccess.MCs = new List<string>() { "11111" };
CurrentUserAccess.Locs = new List<string>() { "11111" };
CurrentUserAccess.Depts = new List<string>() { "1111" };
}
break;
case "mc":
mc = !mc;
if (mc)
{
loc = false;
region = false;
CurrentUserAccess.MCs= new List<string>();
CurrentUserAccess.Locs = new List() { "11111"}; CurrentUserAccess.Depts = new List() { "1111" };
}
break;
case "loc":
loc = !loc;
if (loc)
{
mc = false;
region = false;
CurrentUserAccess.MCs = new List<string>();
CurrentUserAccess.Locs= new List<string>();
CurrentUserAccess.Depts = new List<string>() { "1111" } ;
}
break;
}
}
I just found that the issue is happening when I only havr single selected item in dropdown, if I select 2 or more then UI reseting proparly as expected according to property value set in code behind but if I select only one and try to change value from code behind in UI it will show previous selection as well as the ome set from code