Datagridview在自动addind行功能处于活动状态时添加新行 [英] Datagridview Adding a new row while automatic addind row function is active

查看:87
本文介绍了Datagridview在自动addind行功能处于活动状态时添加新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

DataGridView配置为自动挂载新行:AllowUserToAddRows = true;
The DataGridView is configured to autoappend a new row: AllowUserToAddRows = true;

推荐答案

您是否考虑过删除用户添加新行的功能行设置

Have you considered removing the user's ability to add new rows by setting

AllowUserToAddRows = false;

然后将数据附加为绑定集合中的新项目和设置焦点。

Then appending your data as a new item in the bound collection and setting focus.

更好的IMO。

制作用户编辑并插入与数据网格分开的新数据。

Making the user edit and insert new data separate from the datagrid.

这使您可以准确控制发生的情况并强制用户明确提交或中止。

This allows you to control exactly what's happening and force the user to commit or abort explicitly.

他们可能倾向于像处理excel电子表格那样处理数据网格。

They can have a tendency to treat a datagrid like an excel spreadsheet otherwise.


这篇关于Datagridview在自动addind行功能处于活动状态时添加新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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