private void SetAllCellsState(DataGridViewRow row) { foreach (DataGridViewCell dataGridViewCell in row.Cells) { CellTag cellTag = dataGridViewCell.Tag as CellTag; if (cellTag != null && cellTag.IsReadOnly) { dataGridViewCell.ReadOnly = true; dataGridViewCell.Style = this.m_readOnlyStyle; } } }
static CellTag() { CellTag.s_readOnly = new CellTag(true); CellTag.s_notReadOnly = new CellTag(false); }