コード例 #1
0
        private void Form_gestionReservation_modif_Load(object sender, EventArgs e)
        {
            int indexAdherent = GestionClub.getIndexOfAdherent(Convert.ToInt32(cb_gestionReservation_modif_adherent.ValueMember));

            #region Loading comboBox Adhérent

            this.cb_gestionReservation_modif_adherent.SelectedIndexChanged -= new EventHandler(cb_gestionReservation_modif_adherent_SelectedIndexChanged);
            cb_gestionReservation_modif_adherent.DataSource    = GestionClub.getTousLesAdherents();
            cb_gestionReservation_modif_adherent.DisplayMember = "EtatCivil";
            cb_gestionReservation_modif_adherent.ValueMember   = "Numero";

            //On désélectionne les valeurs (ici le DataSource séléctionne par défaut la première valeur de la liste)
            cb_gestionReservation_modif_adherent.SelectedIndex              = indexAdherent;
            this.cb_gestionReservation_modif_adherent.SelectedIndexChanged += new EventHandler(cb_gestionReservation_modif_adherent_SelectedIndexChanged);
            #endregion

            #region Loading comboBox nbJoueurs
            foreach (int nbPlaces in GestionClub.getParamNbJoueursCourt())
            {
                cb_gestionReservation_modif_nbJoueurs.Items.Add(nbPlaces);
            }
            #endregion
        }