public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
dataGridView1.CellEndEdit += dataGridView1_CellEndEdit;
}
public void recalculateRow(int rowInx){
var zak = dataGridView1.Rows[rowInx].Cells[0].Value;
var perc = dataGridView1.Rows[rowInx].Cells[1].Value;
dataGridView1.Rows[rowInx].Cells[2].Value = "";
if (zak == null || perc == null)
return;
try{
dataGridView1.Rows[rowInx].Cells[2].Value = float.Parse(zak.ToString()) + float.Parse(zak.ToString()) * (float.Parse(perc.ToString())/100);
}catch(FormatException e){
}
}
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e) {
recalculateRow(e.RowIndex);
}
}