如何使用关键字事件添加表新行 [英] How to add tables new row with keyword event

查看:62
本文介绍了如何使用关键字事件添加表新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已在数据表中添加数据
现在,我必须在关键字enter事件中添加新行.有没有可能?
如果可能的话,请..

i''ve added data in data table
now i''ve to add new row at keyword enter event. is it possible or not?
if possible please..

推荐答案

答案是肯定的

1.在DataGridView上添加KeyDown事件,然后在此事件中向数据表添加新行.

您应该已经将DataTable与gridview绑定在一起,这可以通过使用以下代码来完成:

DataGridView1.Source = DataTable1.DefaultView.

如果您对实施有其他要求,请使用改进问题"按钮. :)

肯尼斯(Kenneth)
The answer is yes

1. Add a KeyDown event on the DataGridView and in this event add a new row to the datatable.

You should have binded the DataTable with the gridview, this could be done by using the following code:

DataGridView1.Source = DataTable1.DefaultView.

Please use the improve question button if you have additional requirements on the implementation. :)

Kenneth


这篇关于如何使用关键字事件添加表新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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