开发者

DataGridView column with buttons for only some entries?

开发者 https://www.devze.com 2023-02-09 12:18 出处:网络
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 abl开发者

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 abl开发者_如何转开发e to find a way to invisibilify (or perhaps even disable) certain buttons.

Is there a way of doing this?


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号