下拉列表中项目的唯一选择 [英] Unique selection of items in dropdownlists

查看:111
本文介绍了下拉列表中项目的唯一选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在asp.net中有一些Dropdownlists.全部都绑定有相同的数据.
例如,考虑1,2,3,4,5是下拉列表的列表项.当用户在任何下拉列表中选择3时,它将在剩余的DDls中不可用.其他下拉菜单具有相同的功能,因此我们的选择应该是唯一的.如果取消选择3并选择5,则其余DDls中应该有3个可用.请帮助我解决任何问题.

Hi,
I am having some number of Dropdownlists in asp.net. All are binding with same data.
For example Consider 1,2,3,4,5 are the listitems to the dropdownlists. When user selects 3 in any dropdownlist it should not available in remaining DDls. Same functionlaity for other dropdowns so that our selection should be unique.And if deselect 3 and selected 5 then 3 should available in remaining DDls. Please help me with any apporoach.

推荐答案

使用OnSelectedIndex更改事件.从其他DDL控件中删除一个选定的项目.
Use the OnSelectedIndex changed event. Remove the one selected item from the other DDL controls.


不是让多个下拉列表都填充相同的值,而是为什么不执行选中的multiselect下拉列表之类的内容呢?
https://github.com/scottwb/jquery.ui.dropdownchecklist [
Instead of having multiple dropdowns all populated with the same values, why not implement something like a checked multiselect dropdownlist?
https://github.com/scottwb/jquery.ui.dropdownchecklist[^]
The samples included in this library are very good. I''ve used this library extensively and it is a godsend to issues like what you are describing.


这篇关于下拉列表中项目的唯一选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆