This is either me not understanding the order of constructor execution or not understanding the precedence of ReadOnly fields on DataGridViews.
class Form1 : Form
{
public Form1()
{
DataGridView gv = new DataGridView();
Controls.Add(gv);
gv.Columns.Add("foo","foo");
gv.Rows[gv.Rows.Add()].ReadOnly = true;
gv[0,0] = new DerivedCell();
//gv[0,0].ReadOnly = false;
}
}
class DerivedCell : DataGridViewTextBoxCell
{
public DerivedCell()
{
ReadOnly = false;
}
}
The commented line is needed if I want to make the cell editable, but I don't understand why that isn't taken care of in the DerivedCell ctor.