private void metroGridSmer_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataGridViewRow selectedRow = null; if (metroGridSmer.SelectedRows.Count > 0) { selectedRow = metroGridSmer.SelectedRows[0]; } if (selectedRow == null) { return; } int smerId = Convert.ToInt32(selectedRow.Cells["Id"].Value.ToString()); if (!FormMain.Instance.Container.Controls.ContainsKey("UcRazredi")) { UcRazredi uc = new UcRazredi(smerId) { Dock = DockStyle.Fill }; FormMain.Instance.Container.Controls.Add(uc); } UcRazredi muc = (UcRazredi)FormMain.Instance.Container.Controls["UcRazredi"]; muc.SmerId = smerId; FormMain.Instance.Container.Controls["UcRazredi"].BringToFront(); }
private void FormMain_Load(object sender, EventArgs e) { UcRazredi uc = new UcRazredi() { Dock = DockStyle.Fill }; metroPanelMain.Controls.Add(uc); metroPanelMain.Controls["UcRazredi"].BringToFront(); Text = Text + " - " + DocumentumFactory.Login.ime + " " + DocumentumFactory.Login.prezime; }