首页 > Windows开发 > 详细

DataGridView 设计

时间:2020-04-13 19:37:41      阅读:62      评论:0      收藏:0      [点我收藏+]

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

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 设计

原文:https://www.cnblogs.com/James007/p/12693066.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!