如何从datagridcolumncheckbox.checked返回到datagridcolumncheckbox.unchecked [英] How can I return back from datagridcolumncheckbox.checked to datagridcolumncheckbox.unchecked

查看:89
本文介绍了如何从datagridcolumncheckbox.checked返回到datagridcolumncheckbox.unchecked的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据网格带有复选框列:



< datagridcheckboxcolumn.cellstyle>



& LT; EventSetter Event =CheckBox.CheckedHandler =Event_OnChecked/>







我需要在处理程序(Event_OnChecked)中返回CheckBox处于未选中状态



请参阅。帮助(花了3个小时没有结果)

谢谢



我尝试了什么:



我试过e.Handled = True

没有结果

解决方案

不确定你是否找到你的答案....



Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object,ByVal e As System.Windows.Forms.DataGridViewCellEventArgs)处理DataGridView1.CellContentClick < br $>


DataGridView1.EndEdit()

DataGridView1.Rows(e.RowIndex).Cells(复选框的列).Value = False


结束子



你可以这样做,或者如果你可以在偶数处理程序中获得行,在那里做。

基本上你必须关闭复选框。

.EndEdit()设置检查以使其完成,然后将其设置为false以将其关闭

I have datagrid with checkbox column:

<datagridcheckboxcolumn.cellstyle>

&lt;EventSetter Event="CheckBox.Checked" Handler="Event_OnChecked"/>



I need in handler ("Event_OnChecked") return CheckBox in Unchecked state

pls. help (spent 3 hours with no result)
thanks

What I have tried:

I tried e.Handled = True
No result

解决方案

Not sure if you found your answer....

Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick

DataGridView1.EndEdit()
DataGridView1.Rows(e.RowIndex).Cells(column of checkbox).Value = False

End Sub

you can do it this way, or if you can get the row in your even handler, do it there.
Basically you have to turn off the check box.
the .EndEdit() sets the check so it is completed, then set it to false to turn it off


这篇关于如何从datagridcolumncheckbox.checked返回到datagridcolumncheckbox.unchecked的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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