从未绑定的组合框列检索值 [英] Retreiving values from an unbound ComboBox column

查看:70
本文介绍了从未绑定的组合框列检索值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮助我检索未绑定DataGridView上未绑定ComboBox列中的值吗?我没有从未绑定的文本框"列获取值的问题,但是我无法弄清楚如何从未绑定的组合框获取值.

Can anyone help me to retreive values from an unbound ComboBox column on an unbound DataGridView? I''ve had no problems getting values from unbound Textbox columns, but I can''t figure out how to get values from an unbound Combobox.

推荐答案

Standard ComboBox类(用于Forms或WPF)没有列.要读取值,请使用属性ComboBox.Items;不要假设字符串;这些对象可以是任何类型.您可以使用"foreach"迭代值,也可以使用整数索引("[]")来检索项目.

您没有标记要使用的UI库,因此我没有为您提供指向MSDN帮助页面的确切Web链接;您可以轻松地自己找到它.

请始终对其进行标记.使用改善问题"来解决.

—SA
Standard ComboBox classes (for Forms or WPF) does not have columns. To read the values, use the property ComboBox.Items; don''t assume strings; the objects can be of any type. You can iterate values using "foreach" or use integer index ("[]") to retrieve an item.

You did not tag the UI library you want to use, so I don''t give you exact Web link to MSDN help page; you will easily find it by yourself.

Please, always tag it. Use "Improve question" to fix it.

—SA


这篇关于从未绑定的组合框列检索值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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