如何在C#中处理动态组合框selectedIndexchanged事件? [英] how to handle dynamic combo box selectedIndexchanged event in c#?

查看:166
本文介绍了如何在C#中处理动态组合框selectedIndexchanged事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在动态创建组合框,并将列表绑定到每个组合框.
在函数的SelectedIndexChanged事件中,我正在显示组合框值
到richtextbox.
Richtextbox正确填充了所有组合框值.

但是问题是,每当我从下拉菜单中的任何一个中选择值时,所有下拉菜单中的值都将变为相同的值.

请提出执行此操作的代码逻辑或想法..

在此先感谢!!''
Mohana

HI all,

I am creating combo boxes dynamically and binding the list to each combobox.
In SelectedIndexChanged event of the function i am displaying the combo box values
to richtextbox.
Richtextbox is populating with all the combobox values correctly.

But the problem is, whenever i am selecting the values from anyone of the drop down.Then all the drop down values changing into the same value.

Please can suggest the code logic or idea for doing this..

Thanks in Advance!!''
Mohana

推荐答案

请不要从您动态创建的dropdown对象中获取值.


获取发送方对象,然后键入强制发送方以下拉对象并设置值.从对象中可以获取并设置值.
Please do not get the value from the object of dropdown,which was dynamically created by you.


Get the sender object and type casting the sender to drop down object and set the value. From the object you can get and set the value.


这篇关于如何在C#中处理动态组合框selectedIndexchanged事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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