Exemplo n.º 1
0
        private void LoadAllTornei()
        {
            dataGridViewTornei.DataSource = SqlDal_Tournaments.GetAllTornei().ToArray();

            dataGridViewTornei.Columns["TournamentId"].Visible        = false;
            dataGridViewTornei.Columns["TournamentName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;

            if (dataGridViewTornei.ColumnCount <= 5)
            {
                DataGridViewButtonColumn btn = new DataGridViewButtonColumn();
                dataGridViewTornei.Columns.Add(btn);
                btn.HeaderText = "Elimina";
                btn.Text       = "Elimina";
                btn.Name       = "btn";
                btn.UseColumnTextForButtonValue = true;
            }
        }