private void SelectCellFromGroupRow(DataGridViewCellMouseEventArgs e) { if (e.Button == MouseButtons.Right) { ShowContextMenu(e); return; } var groupRepository = new GroupRepository(); var table = groupRepository.FindAllFrom(_inspectingList.Last()); var groupId = table.Rows[e.RowIndex].Field <int>("GroupID"); _inspecting = Inspecting.Students; _inspectingList.Add(groupId); RefreshStudentsList(groupId); }