我發現了很多類似的問題和答案,但沒有人幫助我解決我的問題。如何禁用dataGridView中不可點擊的按鈕(c#windows應用程序)
這裏是我現在面臨這個問題 dataGridView with buttoncell
我想如果按鈕上的文字說:「接受的」禁止(或不點擊)按鈕我的應用程序的截圖, 這裏就是我並且不工作
private void Cellcontent()
{
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if ((row.Cells["Status"].Value.ToString()) == "ACCEPTED")
{
DataGridViewButtonCell cell = row.Cells["Status"] as DataGridViewButtonCell;
cell.ReadOnly = true; //if 1 cell will be disabled (not clickable)
}
}
}