最近需用上 DataGridView控件来显示机器点位数据编辑
参考一些网上得资料一起进行学习验证。如图为自己验证的东西,大家参考一起学习。
private void button_add_Click(object sender, EventArgs e)
{
#region //方法一
int index = dataGridView1.Rows.Add();
this.dataGridView1.Rows[index].Cells[0].Value = index+1;
this.dataGridView1.Rows[index].Cells[1].Value = num_x.Value;
this.dataGridView1.Rows[index].Cells[2].Value = num_y.Value;
this.dataGridView1.Rows[index].Cells[3].Value = num_z.Value;
this.dataGridView1.Rows[index].Cells[4].Value = num_t.Value;
#endregion
}
private void Form1_Load(object sender, EventArgs e)
{