使用c#.net在win应用程序中将自定义控件添加到gridview中 [英] Adding Custom Control into gridview in win application using c#.net

查看:109
本文介绍了使用c#.net在win应用程序中将自定义控件添加到gridview中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了包含gridview和按钮的自定义控件,我想从gridview单元格中调用它。

解决方案

检查这个

http://www.c-sharpcorner.com/UploadFile/LivMic/UC_InsideGV02202007133624PM/UC_InsideGV.aspx [ ^ ]

1。
你不能在datagridview中添加自定义控件

你应该创建一个这种类型的自定义控件



2. br />
你可以在按钮中添加自定义控件但是你应该使用像panel,tabellayoutpanel这样的容器

例如

 button1.Controls.Add( new  MyCustomControl1()); 



< br $>
快乐编码!

:)


I have created custom control which contains gridview and buttons,I want to to call it from gridview cell.

解决方案

check this
http://www.c-sharpcorner.com/UploadFile/LivMic/UC_InsideGV02202007133624PM/UC_InsideGV.aspx[^]


1. you can not add custom control in datagridview
you should create a column of that type of custom control

2.
you can add custom control in button but you should use containers like panel, tabellayoutpanel
e.g.

button1.Controls.Add(new MyCustomControl1());



Happy Coding!
:)


这篇关于使用c#.net在win应用程序中将自定义控件添加到gridview中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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