datagridview 增加新行时,能自动复制上一行的信息
数据定义为
DataTable newTable = new DataTable();
newTable.Columns.Add("工号", typeof(string));
newTable.Columns.Add("派令单", typeof(string));
newTable.Columns.Add("机台", typeof(string));
newTable.Columns.Add("生产数量", typeof(decimal));
newTable.Columns.Add("工时", typeof(decimal));
newTable.Columns[3].DefaultValue = "0.00";
newTable.Columns[4].DefaultValue = "0.00";
this.dataGridView1.DataSource = newTable;
dataGridView里面的数据,我是手工输入的,为了方便操作人员使用,我想增加以下功能。当输入一行结束时,新增加一行数据,怎么样才能让她默认新增加的数据为‘工号’,‘派令单’,‘机台’三个字段为上一行输入的数据。
我是超级菜鸟,请高手指点一下。最好能给一个例子。谢谢
DataTable newTable = new DataTable();
newTable.Columns.Add("工号", typeof(string));
newTable.Columns.Add("派令单", typeof(string));
newTable.Columns.Add("机台", typeof(string));
newTable.Columns.Add("生产数量", typeof(decimal));
newTable.Columns.Add("工时", typeof(decimal));
newTable.Columns[3].DefaultValue = "0.00";
newTable.Columns[4].DefaultValue = "0.00";
this.dataGridView1.DataSource = newTable;
dataGridView里面的数据,我是手工输入的,为了方便操作人员使用,我想增加以下功能。当输入一行结束时,新增加一行数据,怎么样才能让她默认新增加的数据为‘工号’,‘派令单’,‘机台’三个字段为上一行输入的数据。
我是超级菜鸟,请高手指点一下。最好能给一个例子。谢谢
...全文
相关推荐
DataGridView使用技巧
DataGridView的常用使用技巧.
DataGridView控件用法合集
DataGridView控件用法合集DataGridView控件用法合集DataGridView控件用法合集DataGridView控件用法合集DataGridView控件用法合集DataGridView控件用法合集DataGridView控件用法合集
【C#源码】DataGridView复制粘贴
DataGridView支持复制粘贴内容,像Excel操作那样。
C# 实现dataGridView选中一行右键出现菜单的示例代码
主要介绍了C# 实现dataGridView选中一行右键出现菜单,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
DataGridView自动调整行高和行宽
DataGridView1.AutoSizeColumnsMode=DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader ///根据数据内容自动调整列宽 DataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCellsExceptHeaders ///根据数据内容自动调整行高 您可能感兴趣的文章:C# DataGridView添加新行的2个方法WinForm中DataGridView添加,删除,修改操作具体方法DataG


