private void View_ModifyExercise(object sender, EventArgs e) { var positionModifyingRow = view.CurrentGridCursorPosition; viewDialog.SetFormName("Modify existed exercise"); currentExercise = (view.GetCurrentRow() as Exercise); if (currentExercise != null) { var exercise = exerciseReposytory.GetOne(currentExercise.Id); viewDialog.SetName(exercise.Name); viewDialog.SetDescription(exercise.Description); viewDialog.ShowDialog(); FillGrid(); view.CurrentGridCursorPosition = positionModifyingRow; } }