如图,我想要给DataGrid添加行,为什么报错说找不到,没添加引用呢?该怎么解决
我的代码 datagrid1是我DataGrid控件的name

报错

在做一个选择文件夹输出文件夹中部分信息用列表显示的功能
int index=this.dataGridView1.Rows.Add();
dataGridView1.Rows[index].Cells[0].Value = "";
dataGridView1.Rows[index].Cells[1].Value = "";
dataGridView1.Rows[index].Cells[2].Value = "";