如何将控件(或用户控件)添加到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.