示例#1
0
 private void cmbCountry_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         ListRadio           objListRadio = new ListRadio(cmbCountry.SelectedValue.ToString());
         List <RadioChannel> lst          = objListRadio.GetCountryWiseRadio();
         lst.Insert(0, new RadioChannel {
             Country = "Select...", Name = "Select...", Url = ""
         });
         cmbChannel.DataSource    = lst;
         cmbChannel.DisplayMember = "Name";
         cmbChannel.ValueMember   = "Url";
     }
     catch (Exception ex) { MessageBox.Show(ex.Message); }
 }
示例#2
0
        public MainForm()
        {
            try
            {
                InitializeComponent();

                ListRadio           objListRadio = new ListRadio();
                List <RadioChannel> lst          = objListRadio.GetAllCountry();
                lst.Insert(0, new RadioChannel {
                    Country = "Select...", Name = "Select...", Url = ""
                });
                cmbCountry.DataSource    = lst;
                cmbCountry.DisplayMember = "Country";
                cmbCountry.ValueMember   = "Country";
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }