用户删除最后一个非空行后,DataGridView会添加新行 [英] DataGridView adds new row after user deletes last non-empty row
问题描述
我有一个数据绑定DGV,AllowUserToAddRows设置为True。 当DGV只有一行(除了标有"*"的空行)并且用户删除它时,DGV将焦点设置为先前标记为"*"的空行,更改行标题
到"> *"并将行状态更改为新建。 我的数据源现在有两行:一个状态已删除,另一个状态已添加。
I have a databound DGV with AllowUserToAddRows set to True. When the DGV has only one row (besides the empty one marked by "*") and user deletes it, the DGV sets focus to the empty row previously marked by "*", changes the row header to ">*" and changes row status to New. My data source has now two rows: one in status deleted and another in status added.
是否可以更改此行为,以便DGV无法启动添加行没有剩下实际的数据行? 否则,我该如何取消这个新行呢?
Is it possible to alter this behaviour so that DGV would not initiate adding a row once there are no actual data rows left? Otherwise, how can I cancel this new row?
我正在使用VS2008。
I am using VS2008.
推荐答案
当DGV只有一行时(除了标有"*"的空行)
When the DGV has only one row (besides the empty one marked by "*")
这个开始是什么意思?
What does this start mean?
这篇关于用户删除最后一个非空行后,DataGridView会添加新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!