在datagridview中删除单元格为空的行 [英] Removing a row with the cell empty in datagridview
本文介绍了在datagridview中删除单元格为空的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个DataGridView
,我在其中检查用户是否删除了其内容,整个行将被删除,
我尝试了Cell_Validating
事件,但无法删除包含验证单元格的行.
我还尝试了事件Cell_EndEdit
,Row_Leave
和Cell_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,
:)
推荐答案
您是否尝试过处理 ^ ]事件?
使用e.RowIndex
遍历行以检查单元格内容.
Have you tried handling the DataGridView.RowLeave[^] event?
Use thee.RowIndex
to iterate over the row checking the cell contents.
这篇关于在datagridview中删除单元格为空的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文