/// <summary> /// Функция которая открывает форму и вписывает /// изменёные значения в datgrid /// </summary> /// <param name="motion"></param> /// <param name="rowIndex"></param> private void EditMotion(IMotion motion, int rowIndex) { _motions[rowIndex] = motion; var row = new DataGridViewRow(); row.CreateCells(_dataGridView); var motionType = motion.Name; var motionCalc = motion.CalculateCoordination().ToString("F"); _dataGridView.Rows[rowIndex].Cells[0].Value = motionType; _dataGridView.Rows[rowIndex].Cells[1].Value = motionCalc; }
/// <summary> /// Функция добавляющия в datagrid значения /// </summary> /// <param name="motion"></param> private void AddMotion(IMotion motion) { _motions.Add(motion); var row = new DataGridViewRow(); row.CreateCells(_dataGridView); var motionType = motion.Name; var motionCalc = motion.CalculateCoordination().ToString("F"); row.Cells[0].Value = motionType; row.Cells[1].Value = motionCalc; _dataGridView.Rows.Add(row); }