Datagridview控制win表单 [英] Datagridview control of win forms
本文介绍了Datagridview控制win表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我选择一个单元格时,单元格的记录应该移动到同一datagridview的另一个单元格
when i select a cell the record of the cell should move to another cell of same datagridview
推荐答案
在CellEnter事件中尝试这个
try This in CellEnter Event
if (e.ColumnIndex == 0)
{
dataGridView1.CurrentRow.Cells["ColName2"].Value = dataGridView1.CurrentRow.Cells["ColName1"].EditedFormattedValue.ToString();
dataGridView1.CurrentRow.Cells["ColName1"].Value = "";
}
这篇关于Datagridview控制win表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文