简体   繁体   English

如何在窗口形式的datagridview单元中放置自定义控件

[英]How to place a custom control within a cells of datagridview in window form

i'm developing a window form application. 我正在开发一个窗口窗体应用程序。

i'm in need of placing custom control comprising of two labels within the cells of the datagrid view. 我需要在datagrid视图的单元格中放置包含两个标签的自定义控件。

i have created the custom controls.Guide me to populate the cells with the custom control 我已经创建了自定义控件。指导我用自定义控件填充单元格

I think you want to create your own editing control which implements IDataGridViewEditingControl. 我认为您想创建自己的实现IDataGridViewEditingControl的编辑控件。 See the msdn documentation for IDataGridViewEditingControl Interface . 请参见msdn文档以获取IDataGridViewEditingControl接口 There is an example at the bottom. 底部有一个示例。

After you create your own editing control, you may need to create something like this: How to: Host Controls in Windows Forms DataGridView Cells 创建自己的编辑控件后,您可能需要创建如下内容: 如何:在Windows窗体DataGridView单元中托管控件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM