【发布时间】:2017-09-15 22:44:13
【问题描述】:
我的DataGridView 中有一个DataGridViewButtonCell,我想将属性Visible 设置为True。
我试过了:
DataGridView1.Rows("number of row i want").Cells("number of cell i want").Visible = True
不幸的是,visible 的属性是read only。
这是代码:
Private Sub DataGridView1_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick
'does not work
DataGridView1.Rows(e.RowIndex).Cells(6).Visible = True
End Sub
有谁知道我如何做到这一点?
谢谢。
【问题讨论】:
-
您是否可以将 enabled 设置为 false,或者只是忽略要禁用的按钮的单击事件。
-
两者都是.NET
DataGridViewButtonColumns -
@JohnG 我可以,但我真的想让它不可见,因为它是为了工作
-
@JohnG 我已经看过那篇帖子,但我不明白那里给出的答案可能是因为我不使用 c#
标签: vb.net datagridview cells datagridviewbuttoncolumn