DataGridViewRow row = new DataGridViewRow();
DataGridViewTextBoxCell textboxcell = new DataGridViewTextBoxCell();
textboxcell.Value = C.time;
row.Cells.Add(textboxcell);
DataGridViewTextBoxCell textboxcel2= new DataGridViewTextBoxCell();
textboxcell.Value = C.temperature;
row.Cells.Add(textboxcel2);
dataGridView1.Rows.Insert(1, row);//这句代码保存提供的行索引超出范围。
参数名: rowIndex
DataGridViewTextBoxCell textboxcell = new DataGridViewTextBoxCell();
textboxcell.Value = C.time;
row.Cells.Add(textboxcell);
DataGridViewTextBoxCell textboxcel2= new DataGridViewTextBoxCell();
textboxcell.Value = C.temperature;
row.Cells.Add(textboxcel2);
dataGridView1.Rows.Insert(1, row);//这句代码保存提供的行索引超出范围。
参数名: rowIndex
解决方案 »
- 如何在winform,c#循环取listView中的值呢?
- 如何强制覆盖文件,用CopyFile函数
- 滚动条的用法
- 命名空间 system 中不存在类型或命名空间名称 management 是缺少程序集引用吗
- 已知像素数据,利用GDI+快速重建图像对象
- 怎样选择目录??就象flashget的选择下载路径一样
- 请问一个较菜的问题:我电脑上如果不装.net框架,直接用iis来看用c#做的asp.net网页,请问能不能打开asp.net网页啊?谢谢!
- 如何在oracle某个表中的日志添加声音文件
- C#中打印机操作的几个问题.
- 关键字out的引用参数,为何必须要使用=而不能只用+=等操作?
- 问2个控件是什么控件
- textbox 的加减乘除运算
this.dataGridView1.Columns.Add("1", "1");//两个参数,前者为列名,后者为headertext
this.dataGridView1.Columns.Add("2", "2");DataGridViewRow row = new DataGridViewRow();DataGridViewTextBoxCell textboxcell = new DataGridViewTextBoxCell();
textboxcell.Value = 1;
row.Cells.Add(textboxcell);DataGridViewTextBoxCell textboxcel2 = new DataGridViewTextBoxCell();
textboxcel2.Value = 2;//这里是2,是1的话,就覆盖了
row.Cells.Add(textboxcel2);
dataGridView1.Rows.Insert(0, row);//这里是0,索引从0开始。