使用vb.net取消选中datagrid中的复选框时如何清除datagrid中垂直行的单元格 [英] how to clear the cell of perticular row in datagrid when uncheck the checkbox in datagrid using vb.net

查看:110
本文介绍了使用vb.net取消选中datagrid中的复选框时如何清除datagrid中垂直行的单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我试图解决我的要求.我在winforms中有一个DataGrid.在该数据网格中,一个复选框列和另外几列.当我们取消选中datagrid中的复选框时,清除Same Row的其余列值.

Hi Guys, I tried to solve the my requirement. I have a DataGrid in winforms. in that datagrid one checkbox column and another few columns. When we uncheck the checkbox in datagrid , clear the remaining column values of Same Row.

推荐答案

使用datagridview的CurrentCellDirtyStateChange方法

申请条件,
use datagridview''s CurrentCellDirtyStateChange Method

apply condition,
if dgv.currentcell.columnindex=1 then 'use checkbox column's index
    if dgv.currentcell.value= false then
       dgv.currentrow.cells(2).value="" 'make empty that row's cell  
    end if
end if


祝您编码愉快!
:)


Happy Coding!
:)


这篇关于使用vb.net取消选中datagrid中的复选框时如何清除datagrid中垂直行的单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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