ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Combobox child cascade problem
Title:
B
I
{code}
?
My cascade combo cshtml code <div class="efield"> <div class="elabel"> @Html.LabelFor(o => o.Department) </div> <div class="einput"> @(Html.Awe().AjaxRadioListFor(o => o.Department).Combobox()) </div> @Html.ValidationMessageFor(o => o.Department) </div> <div class="efield"> <div class="elabel"> @Html.LabelFor(o => o.Service) </div> <div class="einput"> @(Html.Awe().AjaxRadioListFor(o => o.Service).Parent("Department", "Id").Combobox()) </div> @Html.ValidationMessageFor(o => o.Service) </div> AjaxDropdownFor or Odropdown just work fine but AjaxRadioListFor not work. please check this screencast. http://screencast.com/t/EPeHJ1lgMj thanks.
Save Changes
Cancel
user
asked at 28 Jul 2016
Answers
B
I
{code}
?
when you change the value of the parent, the child combobox gets a new list of options to pick from, but the value remains the same, and is not present in the list of options anymore you can return in GetItems AweItems, like this: return Json(new AweItems { Items = items }); aweitems lets you also set the value, but we need to clear it in some cases you may want to leave the current value, like when the value is present in `items`, in that case you can set it { Items = items, Value = v } another way would be to return items + currently selected item
Save Changes
Cancel
Omu
answered at 28 Jul 2016
AweItems work great. Thanks.
at 28 Jul 2016
user
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK