I’m trying to disable particular ButtonCells in DataGridView.
The following doesn’t work.
foreach (var row in dataGrid.Rows)
{
((DataGridViewButtonCell) row.Cells["ColumnX"]).State = DataGridViewElementStates.ReadOnly;
((DataGridViewButtonCell) row.Cells["ColumnX"]).ReadOnly = true;
}
Best regards
Corvin
Hi Corvin,
we looked at it and from what we found ReadOnly is not the same as Disabled.
The DataGridView does not have the Disabled property for button or linked cells.
So you could either create a custom column/cell that adds the Disabled property
or simply ignore the click when ReadOnly = true.
We´ll add the Disabled property as enhancement request WJ-8689.
Best regards
Frank
Please login first to submit.