I am making several custom DataGridViewCell classes to handle various cases in my C# application. One of the custom classes is associated with read-only data, so I'm attempting to make the cell itself read-only.
I initially tried setting the ReadOnly property in the constructor, but doing so causes an InvalidOperationException: "ReadOnly property of a cell cannot be set before it is added to a row."
Which method should I override (i.e., which method adds the cell to the row), so that I can set the ReadOnly property?