为什么dataGridView的第一个行不能被隐藏
如题
Me.DataGridView1.Rows.Item(0).Visible = False
报错
[解决办法]
报错是因为当前选中的Cell在这一行中,因此不能隐藏.所以只需把选中的Cell设为其他行中的Cell,再隐藏第一行就行了.如下:
DataGridView1.CurrentCell = DataGridView1.Rows(1).Cells(1)
DataGridView1.Rows(0).Visible = False