在网格视图的另一个视图中不显示一个下拉列表的选定值 [英] Not showing selected value of one drop down list in another of a gridview

查看:83
本文介绍了在网格视图的另一个视图中不显示一个下拉列表的选定值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我有一个包含下拉列表的gridview.我希望从下拉列表中选择的值不会出现在下一个下拉列表中.

我该如何解决这个问题.欢迎使用代码和建议的链接.

例如:假设我有一个城市的下拉列表.如果我从第一个下拉列表中选择孟买",则孟买"不应出现在下一个下拉列表中.

Hello guys, I have a gridview with dropdown lists in them. I want the selected value from the dropdownlist to not appear in the next dropdown list.

How can I go about this problem. Links to code and suggestions are most welcome.

Eg : Suppose I have a drop down list for Cities. If I select ''Mumbai'' from the first drop down list then ''Mumbai'' should not appear in the next drop down list.

推荐答案

使用数据表,则可以使用列更改事件,如果有人更改了数据网格中的下拉菜单,则会更新数据表.

您可以在事件处理程序内进行for循环,以检查该值是否唯一,并更改任何不唯一的值.

单击链接以获取数据表事件和示例代码的列表:-

http://msdn.microsoft.com/en-us/library/9hx67se8 (v = vs.100).aspx [
If you are using data tables then you can use the column changed event, if someone changes the dropdown in the data grid, it updates the data table.

You can do a for loop inside the event handler to check to see if the value is unique and change any values that are not unique.

Click the link for a list of datatable events and sample code:-

http://msdn.microsoft.com/en-us/library/9hx67se8(v=vs.100).aspx[^]


这篇关于在网格视图的另一个视图中不显示一个下拉列表的选定值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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