3

I have a DataGridView that needs a delete button for each row that has data: some rows may not have data. The DataGridViewButtonColumn seems to put a button in every cell, and I haven't been able to find a way to invisibilify (or perhaps even disable) certain buttons.

Is there a way of doing this?

Smashery
  • 57,848
  • 30
  • 97
  • 128

1 Answers1

-1

Looks like a bit of a hack...but you might be able to "remove" the button on certain rows... see: Datagridview, disable button/row

Dim cell As DataGridViewButtonCell = dgv.row(x).cell(y)
cell = New DataGridViewTextBoxCell()
cell.value = String.Empty
cell.ReadOnly = True
Community
  • 1
  • 1
John K.
  • 5,426
  • 1
  • 21
  • 20