如何在DataGridView中使用ComboBox? [英] How to work with a ComboBox in a DataGridView?

查看:73
本文介绍了如何在DataGridView中使用ComboBox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个名为SubDataGridView的DataGridView,它包含一列组合框。我打算做的是当按下一个btn(在DataGridView之外)时,在某个单元格中选择某个索引,这意味着不包括EditingControlShowing事件。我尝试使用DataGridViewComboBoxCell,但问题是它没有具有'SelectedIndex'属性。那我怎么解决呢?越来越多的我开始考虑获取某个单元格的子代并将其转换为组合框(注意:如果可以,那么我需要负责它的代码)。

解决方案

这会回答你的问题吗?





http://msdn.microsoft.com/en-us/library/ms404353%28v=vs.110%29.aspx [ ^ ]

I'm working with a DataGridView Called "SubDataGridView", where it contains a column of comboboxes. What I intend to do is that when a btn(outside the DataGridView) is pressed, a certain Index is selected in a certain cell,which means the EditingControlShowing Event is excluded .I tried using a DataGridViewComboBoxCell, but the problem is that it does not has the 'SelectedIndex' property. So how can I solve it? More and more I started thinking of getting the children of a certain cell and converting it to a combobox(Note: if this is possible then I need the code responsible for it).

解决方案

does this answer your questions?


http://msdn.microsoft.com/en-us/library/ms404353%28v=vs.110%29.aspx[^]


这篇关于如何在DataGridView中使用ComboBox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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