/// <summary> /// Event handler - kliknutie na tlacitko /// Kliknutie na tlacitko vytvorit udalost /// </summary> /// <param name="sender">odosielatel event-u</param> /// <param name="e">event parameter</param> private void vytvorit_udalost_btn_Click(object sender, EventArgs e) { UdalostOkno okno = new UdalostOkno(); // odznacim header check box ak bol zaskrtnuty if (((CheckBox)this.udalostiDataGridView1.Controls["header_checkbox"]).Checked) { ((CheckBox)this.udalostiDataGridView1.Controls["header_checkbox"]).Checked = false; } okno.ShowDialog(this); }
/// <summary> /// Event handler - kliknutie na bunku /// Kliknutie na riadok - upravit Udalost (zobrazenie detailu udalosti) /// </summary> /// <param name="sender">odosielatel event-u</param> /// <param name="e">event parameter</param> private void udalostiDataGridView_CellClick(object sender, DataGridViewCellEventArgs e) { // ak nebolo kliknute na column header ani na stplec 0 a 1 if (e.RowIndex != -1 && e.ColumnIndex != 0 && e.ColumnIndex != 1) { // ziskam objekt Udalost u = (Udalost)udalostiDataGridView1.SelectedRows[0].DataBoundItem; UdalostOkno okno = new UdalostOkno(u.Id); // odznacim header check box ak bol zaskrtnuty if (((CheckBox)this.udalostiDataGridView1.Controls["header_checkbox"]).Checked) { ((CheckBox)this.udalostiDataGridView1.Controls["header_checkbox"]).Checked = false; } // otvorim detail okno.ShowDialog(this); } }