Ejemplo n.º 1
0
        private void initTab(int i, TabPage tabPage, RezultatskoTakmicenje rezTakmicenje)
        {
            DataGridViewUserControl dataGridViewUserControl =
                new DataGridViewUserControl();

            dataGridViewUserControl.Anchor   = this.dataGridViewUserControl1.Anchor;
            dataGridViewUserControl.Location = this.dataGridViewUserControl1.Location;
            dataGridViewUserControl.Size     = this.dataGridViewUserControl1.Size;
            dataGridViewUserControl.TabIndex = this.dataGridViewUserControl1.TabIndex;
            GridColumnsInitializer.initGimnasticarUcesnik(dataGridViewUserControl);
            dataGridViewUserControl.GridColumnHeaderMouseClick += new EventHandler <GridColumnHeaderMouseClickEventArgs>(dataGridViewUserControl_GridColumnHeaderMouseClick);
            dataGridViewUserControl.DataGridView.MouseUp       += DataGridView_MouseUp;

            tabPage.SuspendLayout();    // NOTE: ovo je obavezno, jer bez toga naredba
            // tabPage.Controls.Add(dataGridViewUserControl) pozicionira
            // user controlu unutar taba pre nego sto je zavrsena inicijalizacija
            // taba, i kao rezultat se dobija pogresna pozicija
            tabPage.Controls.Add(dataGridViewUserControl);
            tabPage.Location = this.tabPage1.Location;
            tabPage.Padding  = this.tabPage1.Padding;
            tabPage.Size     = this.tabPage1.Size;
            tabPage.TabIndex = i;
            tabPage.Text     = rezTakmicenje.Naziv;
            tabPage.UseVisualStyleBackColor = this.tabPage1.UseVisualStyleBackColor;
            tabPage.ResumeLayout(false);
        }
Ejemplo n.º 2
0
        private void initUI()
        {
            if (izborTakmicenja)
            {
                this.Text = "Izaberi takmicenje";
            }
            else
            {
                this.Text = "Izaberi gimnasticare";
            }

            dataGridViewUserControl2.GridColumnHeaderMouseClick +=
                new EventHandler <GridColumnHeaderMouseClickEventArgs>(dataGridViewUserControl2_GridColumnHeaderMouseClick);
            GridColumnsInitializer.initGimnasticarUcesnik(dataGridViewUserControl2);
        }
Ejemplo n.º 3
0
        private void initTabs()
        {
            // init first tab
            tabPage1.Text = rezTakmicenja[0].Naziv;
            GridColumnsInitializer.initGimnasticarUcesnik(dataGridViewUserControl1);
            dataGridViewUserControl1.GridColumnHeaderMouseClick +=
                new EventHandler <GridColumnHeaderMouseClickEventArgs>(dataGridViewUserControl_GridColumnHeaderMouseClick);
            dataGridViewUserControl1.DataGridView.MouseUp += DataGridView_MouseUp;

            // init other tabs
            for (int i = 1; i < rezTakmicenja.Count; i++)
            {
                TabPage newTab = new TabPage();
                tabControl1.Controls.Add(newTab);
                initTab(i, newTab, rezTakmicenja[i]);
            }
        }
 public TakmicariKategorijeUserControl()
 {
     InitializeComponent();
     GridColumnsInitializer.initGimnasticarUcesnik(DataGridViewUserControl);
 }