【发布时间】:2014-09-24 04:57:11
【问题描述】:
我像这样在datagridview 添加了复选框
Dim CbxColumn As New DataGridViewCheckBoxColumn
With CbxColumn
.HeaderText = ""
.Name = "Return"
.Width = 50
End With
dgvDetail.Columns.Insert(0, CbxColumn)
当我运行它时显示正确但现在我想动态禁用 dataGridView 上的某些行不是每一行只是某些行依赖于该行中的其他值我的意思是当 column2 具有值“打开”时我尝试这样做
For i = 0 To dgvDetail.Rows.Count - 1
If dgvDetail.Rows(i).Cells(1).Value = "Open" Then
//I want to do what i expect here//
dgvDetail.Rows(i).Cells(1).ReadOnly = True
End If
Next
但它只是无法编辑值,但我更希望它像我们设置 buttoncontrol.enabled=false 时那样禁用为灰色或非活动控件,我该怎么办非常感谢
【问题讨论】:
标签: c# sql-server vb.net