如何在csharp中的datagridview中检查复选框已更改事件 [英] how to get the checkbox checked changed event in datagridview in csharp

查看:133
本文介绍了如何在csharp中的datagridview中检查复选框已更改事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在设计中如下;



i在我的设计中有一个复选框。

当我点击该复选框时,在下面的代码中将出现,



private void checkBox1_CheckedChanged(object sender,EventArgs e)

{



}

上面一个没关系。





但是我在datagridview里面有一个复选框,为什么如何编写checkbox_ checkedchanged代码写入datagridview内的复选框。





请帮帮我。 />


问候,

Narasiman P.



注意它是windows应用程序。

in design as follows;

i have one checkbox in my design.
when i click that checkbox, in the code following will appear,

private void checkBox1_CheckedChanged(object sender, EventArgs e)
{

}
the above one is ok.


But i have one checkbox inside the datagridview, for that how to write the checkbox_ checkedchanged code to be write for the checkbox inside the datagridview.


please help me.

Regards,
Narasiman P.

note it is windows application.

推荐答案

我想你可以使用datagridview的 CellContentClick 事件。看一下这个讨论: http:// stackoverflow .com / questions / 932040 / triggering-a-checkbox-value-changed-event-in-datagridview-c-net [ ^ ]
I think you could use the datagridview''s CellContentClick event. Have a look at this discussion: http://stackoverflow.com/questions/932040/triggering-a-checkbox-value-changed-event-in-datagridview-c-net[^]


你必须处理网格事件,而不是你可以识别选中的复选框



你可以试试



CellClick

CellContentClick

CurrentCellDirtyStateChanged
you have to handle the grid event and than you can identify the checkbox checked or not

you can try

CellClick
CellContentClick
CurrentCellDirtyStateChanged


这篇关于如何在csharp中的datagridview中检查复选框已更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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