datagridview是只读的,安插一行,想让插入的那一行可编辑,为什么不行啊
datagridview是只读的,插入一行,想让插入的那一行可编辑,为什么不行啊?
Dim index As Integer
Dim dgvr As DataGridViewRow
DataGridView1.ReadOnly = True
index = DataGridView1.Rows.Add()
dgvr = DataGridView1.Rows(index)
dgvr.Cells(0).Value = 1
dgvr.Cells(1).Value = 2
'DataGridView1.Rows(index).ReadOnly = False
dgvr.ReadOnly = False
这是我的测试代码,插入的那一行还是不能编辑啊?为什么呢?
------解决方案--------------------
Dim index As Integer
Dim dgvr As DataGridViewRow
DataGridView1.ReadOnly = True
index = DataGridView1.Rows.Add()
dgvr = DataGridView1.Rows(index)
dgvr.Cells(0).Value = 1
dgvr.Cells(1).Value = 2
'DataGridView1.Rows(index).ReadOnly = False
dgvr.ReadOnly = False
这是我的测试代码,插入的那一行还是不能编辑啊?为什么呢?
------解决方案--------------------