private void showSelectedMatch(object sender, DataGridViewCellEventArgs e) { int row = matchesGrid.CurrentCell.RowIndex; var ID = Int32.Parse(matchesGrid[matchesGrid.ColumnCount - 1, row].Value.ToString()); Match handler = repo.GetById(ID); var view = new MatchShow(handler); view.Show(); }