如何将组合框添加到datarid中 [英] how to add combobox into datarid
本文介绍了如何将组合框添加到datarid中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨..
我的问题是如何在数据网格中添加组合框而不是文本框
ie(System.Windows.Fowms.Datarid)?
i将它用于发票账单,所以我必须添加组合框以便我可以绑定它...
但是它太难添加了。
请帮我解决。
提前谢谢。
解决方案
如果这是一个完整的专栏,请参阅: http://msdn.microsoft.com/en-us/library/system.windows。 forms.datagridviewcomboboxcolumn.aspx [ ^ ]。
对于单个单元格,您可以创建适当类型的单元格实例:
< a href =http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcomboboxcell.asp x> http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcomboboxcell.aspx [ ^ ]。
然后你需要用新创建的单元格替换网格视图的某个单元格。
这里讨论,例如,这里:http://social.msdn.microsoft.com/Forums/en-US/winformsdesigner/thread / 63ddb457-f769-44db-87cc-9e88e74929e8 [ ^ ]。
-SA
http://csharp.net-informations.com/datagridview/csh arp-datagridview-combobox.htm [ ^ ]
Hi..
my question is how can i add combo box instead of textbox in datagrid
i.e.(System.Windows.Fowms.Datarid)?
i am using it for invoice bill, so i have to add combobox so that i can bind value to it..
but its going too much difficult to add.
Please help me to solve.
Thanks in advance.
解决方案
If this is a whole column, please see: http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcomboboxcolumn.aspx[^].
For an individual cell, you can create a cell instance of appropriate type:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcomboboxcell.aspx[^].
Then you need to replace some cell of a grid view with a newly created cell.
This is discussed, for example, here: http://social.msdn.microsoft.com/Forums/en-US/winformsdesigner/thread/63ddb457-f769-44db-87cc-9e88e74929e8[^].
—SA
http://csharp.net-informations.com/datagridview/csharp-datagridview-combobox.htm[^]
这篇关于如何将组合框添加到datarid中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文