Well when i run it in debug it says this:
+ $exception {Cannot evaluate expression because the current thread is in a stack overflow state.} System.Exception {System.StackOverflowException}
this Cannot obtain value of local or argument '<this>' as it is not available at this instruction pointer, possibly because it has been optimized away. tphfinal.BalanceForm
when i run it without debug, it just crashes
and its true i have cell changing events inside a cell change events, but its necessary for my program
the line that causes the trouble is this:
private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
try
{
//GASTO
this.dataGridView1.Rows[0].Cells[0].Value = "Gasto";
this.dataGridView1.Rows[0].Cells[1].Value = "l/s";
this.dataGridView1.Rows[1].Cells[0].Value = "Gasto";
this.dataGridView1.Rows[1].Cells[1].Value = "m3/dia";
this.dataGridView1.Rows[0].Cells[2].Value = Convert.ToDouble(this.dataGridView2.Rows[0].Cells[2].Value);
this.dataGridView1.Rows[1].Cells[2].Value = (Convert.ToDouble(this.dataGridView1.Rows[0].Cells[2].Value) * 86400) / 1000;
this.dataGridView1.Rows[0].Cells[17].Value = Lodos.Recirculacion1 * 0.05;
this.dataGridView1.Rows[1].Cells[17].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[17].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[3].Value = Gasto.Gastomedio1 + double.Parse(this.dataGridView1.Rows[0].Cells[17].Value.ToString());
this.dataGridView1.Rows[1].Cells[3].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[3].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[5].Value = (Convert.ToDouble(this.dataGridView1.Rows[3].Cells[4].Value)) * 5 / 86400;
this.dataGridView1.Rows[1].Cells[5].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[5].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[6].Value = this.dataGridView1.Rows[0].Cells[5].Value;
this.dataGridView1.Rows[1].Cells[6].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[6].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[7].Value = this.dataGridView1.Rows[0].Cells[3].Value;
this.dataGridView1.Rows[1].Cells[7].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[7].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[8].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[6].Value) + Convert.ToDouble(this.dataGridView1.Rows[0].Cells[7].Value);
this.dataGridView1.Rows[1].Cells[8].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[8].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[10].Value = Convert.ToDouble(this.dataGridView1.Rows[5].Cells[7].Value) * 50 / 86400;
this.dataGridView1.Rows[1].Cells[10].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[10].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[11].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[10].Value) + Convert.ToDouble(this.dataGridView1.Rows[0].Cells[5].Value);
this.dataGridView1.Rows[1].Cells[11].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[11].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[12].Value = this.dataGridView1.Rows[0].Cells[10].Value;
this.dataGridView1.Rows[1].Cells[12].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[12].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[13].Value = this.dataGridView1.Rows[0].Cells[8].Value;
this.dataGridView1.Rows[1].Cells[13].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[13].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[14].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[12].Value) + Convert.ToDouble(this.dataGridView1.Rows[0].Cells[13].Value);
this.dataGridView1.Rows[1].Cells[14].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[14].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[16].Value = this.dataGridView1.Rows[0].Cells[14].Value;
this.dataGridView1.Rows[1].Cells[16].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[16].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[17].Value = Convert.ToDouble(this.dataGridView2.Rows[1].Cells[2].Value) * 0.05;
this.dataGridView1.Rows[1].Cells[17].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[18].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[18].Value = Convert.ToDouble(this.dataGridView2.Rows[1].Cells[2].Value) * 0.15;
this.dataGridView1.Rows[1].Cells[18].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[18].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[19].Value = Convert.ToDouble(this.dataGridView2.Rows[1].Cells[2].Value) * 0.2;
this.dataGridView1.Rows[1].Cells[19].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[19].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[20].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[16].Value) + Convert.ToDouble(this.dataGridView1.Rows[0].Cells[18].Value);
this.dataGridView1.Rows[1].Cells[20].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[20].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[22].Value = Convert.ToDouble(this.dataGridView2.Rows[1].Cells[2].Value) * 0.8;
this.dataGridView1.Rows[1].Cells[22].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[22].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[23].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[20].Value) + Convert.ToDouble(this.dataGridView2.Rows[2].Cells[2].Value);
this.dataGridView1.Rows[1].Cells[23].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[23].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[24].Value = 147.99 * 0.1;
this.dataGridView1.Rows[1].Cells[24].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[24].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[25].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[23].Value) - Convert.ToDouble(this.dataGridView1.Rows[0].Cells[24].Value);
this.dataGridView1.Rows[1].Cells[25].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[25].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[21].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[22].Value) + Convert.ToDouble(this.dataGridView1.Rows[0].Cells[25].Value);
this.dataGridView1.Rows[1].Cells[21].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[21].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[26].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[21].Value);
this.dataGridView1.Rows[1].Cells[26].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[26].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[27].Value = Convert.ToDouble(this.dataGridView2.Rows[1].Cells[2].Value);
this.dataGridView1.Rows[1].Cells[27].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[27].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[28].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[26].Value) - Convert.ToDouble(this.dataGridView1.Rows[0].Cells[27].Value);
this.dataGridView1.Rows[1].Cells[28].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[28].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[29].Value = Convert.ToDouble(this.dataGridView2.Rows[1].Cells[2].Value);
this.dataGridView1.Rows[1].Cells[29].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[29].Value) * 86400 / 1000;
this.dataGridView1.Rows[0].Cells[30].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[28].Value) - Convert.ToDouble(this.dataGridView1.Rows[0].Cells[10].Value);
this.dataGridView1.Rows[1].Cells[30].Value = Convert.ToDouble(this.dataGridView1.Rows[0].Cells[30].Value) * 86400 / 1000;
}
catch{
}
}