2011-02-07 9 views
2

我有一個DataGridView需要每個有數據的行的刪除按鈕:有些行可能沒有數據。 DataGridViewButtonColumn似乎在每個單元格中放置了一個按鈕,我無法找到一種方法來禁用某些按鈕(或者甚至禁用)。只有一些條目的按鈕的DataGridView列?

有沒有辦法做到這一點?

回答

0

看起來像一個黑客位的...但你也許能在一定行「刪除」按鈕... 看到:Datagridview, disable button/row

Dim cell As DataGridViewButtonCell = dgv.row(x).cell(y) 
cell = New DataGridViewTextBoxCell() 
cell.value = String.Empty 
cell.ReadOnly = True 
相關問題