新手,关于C#中DataGridView的问题
蔚蓝理想 2012-03-12 04:53:27 各位高手,看到一段代码,是C#2.0的,内容如下
int row = this.dgCourseList.CurrentCell.RowNumber; //dgCourseList是一个定义的DataGrid对象
this.dgCourseList.CurrentCell = new DataGridCell(row+1,0);
我现在在学C#4.0,在4.0下,好像没有了DataGrid,而是DataGridView,因此,找不到RowNumber属性。请问如何实现呢?我测试了一下,像下面这样提示错误:
int row = this.dgCourseList.CurrentCell.RowIndex;
this.dgCourseList.CurrentCell = new DataGridViewCell(row+1,0);//提示无法创建实例
希望高手帮忙解决,找到替换办法!