问题描述
我有三个下拉列表:"countrydropdown","statedropdown"和"citydropdown".所有下拉列表都相互连接.如果我们更改"countrydropdown"中的值,则"statedropdown"中的列表将自动更改.
现在,我想以编程方式更改"countrydropdown","statedropdown"和"citydropdown"的值,但是"countrydropdown"列表的任何更改都不会影响"statedropdown"的列表.请建议我如何以编程方式刷新dropdownlist.有问题吗?
如果是这样,那么您将需要:
1)创建一个类级别的bool,上面写着我正在更新-忽略事件"
或
2)禁用事件处理程序,直到更新完成.
我会选择前者.
I have three dropdownlists ''countrydropdown'', ''statedropdown'', and ''citydropdown''. All the dropdownlists are connected to each other. If we change a value in ''countrydropdown'', the list in ''statedropdown'' will change automatically.
Now I wanted to change value of ''countrydropdown'', ''statedropdown'' and ''citydropdown'' programatically, but any change of ''countrydropdown'' list does not affect list of ''statedropdown''. Please suggest me how to refresh dropdownlist programatically.
这篇关于更新下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!