private void cmbStatistikaOdabir_SelectedIndexChanged(object sender, EventArgs e) { var toDel = Controls.Find("gridview", true); if (toDel.Length != 0) { this.Controls.Remove(toDel[0]); } int X = Convert.ToInt32(cmbStatistikaOdabir.Location.X); int Y = Convert.ToInt32(cmbStatistikaOdabir.Location.Y) + 50; if (cmbStatistikaOdabir.SelectedItem.ToString().Equals("Igrači")) { gv = new GridView_punjenje('I', X, Y, 0); gv.gv.Name = "gridview"; GV_Click_Igrac(); trenutni = 0; this.Controls.Add(gv.gv); } else if (cmbStatistikaOdabir.SelectedItem.ToString().Equals("Ekipe")) { gv = new GridView_punjenje('S', X, Y, 0); gv.gv.Name = "gridview"; GV_Click_Ekipe(); trenutni = 1; this.Controls.Add(gv.gv); } }
public KoseviSut(char source, Ekipa ek) { ekipa = ek; InitializeComponent(); s = source; if (source == 'E') { lblKoseviSutIzvor.Text = ek.Naziv.ToString(); lblKoseviSutIzvor.Visible = true; } else if (source == 'I') { //grid view se generira gridView = new GridView_punjenje(source, 12, 100, ek.Id); this.Controls.Add(gridView.gv); //dodavanje novog grid view (kontrole) na formu lblKoseviSutIzvor.Text = ek.Naziv.ToString(); lblKoseviSutIzvor.Visible = true; } }