private void btnDodajOrg_Click(object sender, EventArgs e) { FormDodajOrg f = new FormDodajOrg(); f.ShowDialog(); ucitajSveOrgSpon(); }
private void btnIzmeni_Click(object sender, EventArgs e) { if (!Provera.chkIfSelected(dgv1)) { return; } if (dgv1.CurrentRow.DataBoundItem is Sahista) { var item = dgv1.CurrentRow.DataBoundItem; FormDodajSah f = new FormDodajSah(); f.UpdateItem = item as Sahista; f.ShowDialog(); SahistaIzvedeni(dgv1.DataSource as SortableBindingList <Sahista>); } else if (dgv1.CurrentRow.DataBoundItem is Turnir) { var item = dgv1.CurrentRow.DataBoundItem as Turnir; FormDodajTurnir f = new FormDodajTurnir(); f.UpdateItem = item; f.ShowDialog(); } else if (dgv1.CurrentRow.DataBoundItem is Organizator) { var item = dgv1.CurrentRow.DataBoundItem as Organizator; FormDodajOrg f = new FormDodajOrg(); f.UpdateItem = item; f.ShowDialog(); } else if (dgv1.CurrentRow.DataBoundItem is Sponzor) { MessageBox.Show("Ne mozete azurirati sponzora"); } else if (dgv1.CurrentRow.DataBoundItem is Partija) { var item = dgv1.CurrentRow.DataBoundItem as Partija; FormDodajPartija f = new FormDodajPartija(); f.UpdateItem = item; f.ShowDialog(); osveziSudiju(dgv1.DataSource as SortableBindingList <Partija>); } //ovde jedino mora da update i refresh da bi se videle promene dgv1.Update(); dgv1.Refresh(); }