DataGridView 设计

添加行的方式大概有两种:

1、int index=this.dataGridView1.Rows.Add();
this.dataGridView1.Rows[index].Cells[0].Value ="1";
this.dataGridView1.Rows[index].Cells[1].Value ="2";
this.dataGridView1.Rows[index].Cells[2].Value ="监听";
2、DataGridViewRow row= new DataGridViewRow();
DataGridViewTextBoxCell textboxcell= new DataGridViewTextBoxCell();
textboxcell.Value= "aaa";
row.Cells.Add(textboxcell);
DataGridViewComboBoxCell comboxcell= new DataGridViewComboBoxCell();
row.Cells.Add(comboxcell);
dataGridView1.Rows.Add(row);

DataGridView 设计

上一篇:delphi的坐标变换(ClientToScreen等函数的应用)


下一篇:asp.net Core API 获取ip地址