sometimes I want to hide buttons in a DataGridViewButtonColumn

后端 未结 9 1106
清歌不尽
清歌不尽 2020-12-20 15:50

I have a DataGridView which was the subject of a previous question (link). But sometimes the Button is null. This is fine. But if it is null, is th

9条回答
  •  臣服心动
    2020-12-20 16:03

    Padding didn't work for me. I think it is easier and cleaner to just make the cell an empty text cell. VB, but you get the idea:

    Dim oEmptyTextCell As New DataGridViewTextBoxCell()
    oEmptyTextCell.Value = String.Empty
    oRow.Cells(i) = oEmptyTextCell
    

提交回复
热议问题