I've created my own class MyDataGridViewTextBoxEditingControl and my class MyDataGridViewTextBoxCell. Inside the MyDataGridViewTextBoxEditingControl I need receive some information through properties, but I don't know how to send these values from MyDataGridViewTextBoxCell to MyDataGridViewTextBoxEditingControl, then return value from MyDataGridViewTextBoxEditingControl to MyDataGridViewTextBoxCell. I don't know how to exchange information between these two classes through properties. Any help will be very appreciated.
public class MyDataGridViewTextBoxCell : DataGridViewTextBoxCell
{
public double ExactValue { get; set; }
public int DecimalPlaces { get; set; }
public Color ErrorForeColor { get; set; }
public override Type EditType => typeof(MyDataGridViewTextBoxEditingControl);
}
public class MyDataGridViewTextBoxEditingControl : DataGridViewTextBoxEditingControl
{
double exactValue = 0;
int decimalPlaces = 3;
Color errorForeColor = Color.Black;
public double ExactValue { get => exactValue; }
public int DecimalPlaces { get => decimalPlaces; set => decimalPlaces = value; }
public Color ErrorForeColor { get => errorForeColor; set => errorForeColor = value; }
protected override void OnKeyDown(KeyEventArgs e)
{
base.OnKeyDown(e);
//My logic goes here
}
}
I understand that the example above can be achieved in other, easier ways, but this is just a simple example of what I need.