I have a custom one DataGridView, let's say this:
public MyGridView : DataGridView
{
public MyGridView()
{
BackgroundColor = Color.Red;
}
}
Now, when I use this control in a project using a constructor, for some reason it also needs to set a property in the designer.cs file.
So, in the constructor file, I would:
this.MyGridView1.BackgroundColor = System.Drawing.Color.FromArgb((byte)(int)255, (byte)(int)0, (byte)(int)0);
The problem with this is that it does not allow me to change the color in my constructor MyGridView, without having to go through all the forms in which I used to manage and change it to one instance, my user control is useless.
With some properties that virtual getter offers, this is not a problem, but most properties do not have it.
How can I prevent the constructor from creating this code?