private void initUI() { Text = "Raspored sudija - " + DeoTakmicenjaKodovi.toString(raspored.DeoTakmicenjaKod); GridColumnsInitializer.initRasporedSudija(sudijskiOdbor.Id, spravaGridUserControl1.DataGridViewUserControl); spravaGridUserControl1.DataGridViewUserControl.DataGridView.ColumnWidthChanged += new DataGridViewColumnEventHandler(DataGridView_ColumnWidthChanged); }
private void initTab(TabPage tabPage, RasporedSudija raspored) { SpravaGridGroupUserControl spravaGridGroupUserControl = new SpravaGridGroupUserControl(); spravaGridGroupUserControl.Location = USER_CONTROL_LOCATION; spravaGridGroupUserControl.SpravaGridRightClick += new EventHandler <SpravaGridRightClickEventArgs>(spravaGridGroupUserControl1_SpravaGridRightClick); //spravaGridGroupUserControl.Size = this.rasporedSudijaUserControl1.Size; spravaGridGroupUserControl.init(Sprave.getSprave(takmicenje.Gimnastika)); // odredjuje i Size foreach (SpravaGridUserControl c in spravaGridGroupUserControl.SpravaGridUserControls) { SudijskiOdborNaSpravi odbor = raspored.getOdbor(c.Sprava); int odborId = odbor != null ? odbor.Id : 0; GridColumnsInitializer.initRasporedSudija(odborId, c.DataGridViewUserControl); c.DataGridViewUserControl.DataGridView.ColumnWidthChanged += new DataGridViewColumnEventHandler(DataGridView_ColumnWidthChanged); } spravaGridGroupUserControl.TabIndex = this.spravaGridGroupUserControl1.TabIndex; tabPage.SuspendLayout(); tabPage.Controls.Add(spravaGridGroupUserControl); tabPage.BackColor = this.tabPage1.BackColor; tabPage.Location = this.tabPage1.Location; tabPage.Padding = this.tabPage1.Padding; tabPage.Size = this.tabPage1.Size; //tabPage.TabIndex = rasporedi.IndexOf(raspored); // This property is not // meaningful for this control. tabPage.AutoScroll = true; tabPage.AutoScrollMinSize = new Size( spravaGridGroupUserControl.Right, spravaGridGroupUserControl.Bottom); tabPage.AutoScrollMargin = new Size(spravaGridGroupUserControl.Location); tabPage.Text = raspored.Naziv; //tabPage.UseVisualStyleBackColor = this.tabPage1.UseVisualStyleBackColor; tabPage.ResumeLayout(false); }
private void createTab(RasporedSudija raspored) { if (rasporedi.IndexOf(raspored) == 0) // prvi tab { // init first tab if (tabControl1.TabPages.IndexOf(tabPage1) < 0) { tabControl1.TabPages.Add(tabPage1); } spravaGridGroupUserControl1.Location = USER_CONTROL_LOCATION; spravaGridGroupUserControl1.SpravaGridRightClick += new EventHandler <SpravaGridRightClickEventArgs>(spravaGridGroupUserControl1_SpravaGridRightClick); spravaGridGroupUserControl1.init(Sprave.getSprave(takmicenje.Gimnastika)); foreach (SpravaGridUserControl c in spravaGridGroupUserControl1.SpravaGridUserControls) { SudijskiOdborNaSpravi odbor = raspored.getOdbor(c.Sprava); int odborId = odbor != null ? odbor.Id : 0; GridColumnsInitializer.initRasporedSudija(odborId, c.DataGridViewUserControl); c.DataGridViewUserControl.DataGridView.ColumnWidthChanged += new DataGridViewColumnEventHandler(DataGridView_ColumnWidthChanged); } tabPage1.AutoScroll = true; tabPage1.AutoScrollMinSize = new Size( spravaGridGroupUserControl1.Right, spravaGridGroupUserControl1.Bottom); tabPage1.AutoScrollMargin = new Size(spravaGridGroupUserControl1.Location); tabPage1.Text = raspored.Naziv; } else { // init other tabs TabPage newTab = new TabPage(); tabControl1.Controls.Add(newTab); initTab(newTab, raspored); } }
private void promeniStartListuCommand(Sprava sprava) { try { RasporedSudijaEditorForm form = new RasporedSudijaEditorForm( ActiveRaspored.Id, sprava, takmicenje.Id); if (form.ShowDialog() == DialogResult.OK) { rasporedi[tabControl1.SelectedIndex] = form.RasporedSudija; refresh(sprava); // za slucaj da su promenjene sirine kolona GridColumnsInitializer.initRasporedSudija(ActiveRaspored.getOdbor(sprava).Id, getActiveSpravaGridGroupUserControl()[sprava].DataGridViewUserControl); getActiveSpravaGridGroupUserControl()[sprava].clearSelection(); } } catch (InfrastructureException ex) { MessageDialogs.showError(ex.Message, this.Text); } }