Hi! I want define percent product price in percent column. This code worked when I move cursor to percent column. I want after press enter it work. When I press enter cursor move to next row and not work this code.
private void CountForm_Load(object sender, EventArgs e)
{
Grid.ColumnCount = 3;
Grid.Columns[0].Name = "Product ID";
Grid.Columns[1].Name = "Product Price";
Grid.Columns[2].Name = "Percent";
string[] row = new string[] { "1", "0", "" };
Grid.Rows.Add(row);
row = new string[] { "2", "0", "" };
Grid.Rows.Add(row);
row = new string[] { "3", "0", "" };
Grid.Rows.Add(row);
}
private void Grid_CellEnter(object sender, DataGridViewCellEventArgs e)
{
Grid.CurrentRow.Cells[2].Value = (System.Convert.ToDecimal(Grid.CurrentRow.Cells[1].Value) * System.Convert.ToDecimal("0,01"));
}