private void OnGridShowAllRacesForTheDistanceCellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex >= 0) { int raceid = ((RaceInfo) _gridShowAllRacesForTheDistance.Rows[e.RowIndex].Tag).RaceId; var f = new RaceChartForm(raceid); f.ShowDialog(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void OnGridCellClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex >= 0) { if (_winnersNameColumnIndex == e.ColumnIndex) { var ri = (RaceInfo) _grid.Rows[e.RowIndex].Tag; int raceid = ri.RaceId; var f = new RaceChartForm(raceid); f.ShowDialog(); } else if (_distanceColumnIndex == e.ColumnIndex) { SetCurrentRaceInfo((RaceInfo) _grid.Rows[e.RowIndex].Tag); LoadAllRacesForTheDistance(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }