public ControlManageCompetitions() { InitializeComponent(); gridCompetitions.SelectionChanged += GridCompetitions_SelectionChanged; SelectedItem = null; Competitions = new BindingList <CompetitionGrid>(); LoadInfo(); }
private void GridCompetitions_SelectionChanged(object sender, EventArgs e) { if (gridCompetitions.SelectedRows.Count > 0) { SelectedItem = (CompetitionGrid)gridCompetitions.SelectedRows[0].DataBoundItem; tbName.Text = SelectedItem.Name; dpStart.Value = SelectedItem.StartDate; dpEnd.Value = SelectedItem.EndDate; tbDetails.Text = SelectedItem.Details; } }