在datagridview中删除单元格为空的行 [英] Removing a row with the cell empty in datagridview

查看:78
本文介绍了在datagridview中删除单元格为空的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个DataGridView,我在其中检查用户是否删除了其内容,整个行将被删除,

我尝试了Cell_Validating事件,但无法删除包含验证单元格的行.

我还尝试了事件Cell_EndEditRow_LeaveCell_Validated,但是它在删除最后一个数据之前是给我的,而不是空单元格.

请我帮忙,

预先感谢,
:)

Hi all,

I have a DataGridView in which I was checking if the user delete its content, its entire row will be removed,

I tried the Cell_Validating event but it can''t removes the row containing the validating cell.

I also tried the events Cell_EndEdit, Row_Leave and Cell_Validated but it was giving me the last data before deleting it not the empty Cell.

Please I need help,

Thanks in advance,
:)

推荐答案

您是否尝试过处理
Have you tried handling the DataGridView.RowLeave[^] event?

Use the e.RowIndex to iterate over the row checking the cell contents.


这篇关于在datagridview中删除单元格为空的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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