Пример #1
0
        private void FormSerchUserByHobby_Load(object sender, EventArgs e)
        {
            List <HobbyDTO> hobbies = _hc.GetHobies();

            cmbHobbies.DisplayMember = "HobbyName";
            cmbHobbies.ValueMember   = "ID";
            cmbHobbies.DataSource    = hobbies;
            cmbHobbies.SelectedIndex = -1;
        }
Пример #2
0
        private void ComboBoxHobbyFill()
        {
            mainHobbies = _hc.GetHobies();
            HobbyDTO item = new HobbyDTO();

            item.HobbyName = "Ana hobi ekle";
            mainHobbies.Insert(0, item);

            cmbAnaHobiler.DisplayMember = "HobbyName";
            cmbAnaHobiler.ValueMember   = "ID";
            cmbAnaHobiler.DataSource    = mainHobbies;
            cmbAnaHobiler.SelectedIndex = -1;
        }