如何将控件(或用户控件)添加到DataGridViewColumn? [英] How to add a control(or user control) to DataGridViewColumn?

查看:84
本文介绍了如何将控件(或用户控件)添加到DataGridViewColumn?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我要向datagridview添加控件(或用户控件).指定其几何形状后,我可以执行以下操作:

Suppose i want to add a control( or user control) to a datagridview. after specifing its geometry, i can do this:

datagridview1.Controls.Add(usercontrol);



但是我想对DataGridViewColumn进行此操作.我怎样才能做到这一点? (没有类似控件"的属性)



But i want to do this to a DataGridViewColumn. How can i do that? (There is nothing like a ''Controls'' property)

推荐答案

如果我正确理解了这个问题,则想在DataGridView中创建一个自定义列.如果正确,那么这可能会有所帮助:创建自定义DataGridView列 [ ^ ]
If I understood the question correctly, you want to create a custom column in your DataGridView. If that''s correct, then maybe this would help: Create a Custom DataGridView Column[^]


DataGridView .Controls.add(control);
DataGridView.Controls.add(control);


必须重写datagridviewcolumn!我可以给你代码.
Must rewrite datagridviewcolumn! I can give to you the code.


这篇关于如何将控件(或用户控件)添加到DataGridViewColumn?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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