private void RefreshChart()
        {
            var regionSelected = cbbRegion.SelectedItem as ComboData;
            var countySelected = cbbCounty.SelectedItem as ComboData;

            if (regionSelected != null && countySelected != null)
            {
                dgwRegionData.DataSource = DataReaderCounty.ReadCountyData(regionSelected.value, countySelected.value).ToList();
            }
        }
Beispiel #2
0
        private void cbbRegion_SelectedIndexChanged(object sender, EventArgs e)
        {
            cbbCounty.Items.Clear();
            var selected = cbbRegion.SelectedItem as ComboData;
            var county   = DataReaderCounty.ReadCounties(selected?.value ?? 0)
                           .Select(r => new ComboData()
            {
                value = r.codice_provincia, display = r.denominazione_provincia
            }).ToArray();

            cbbCounty.Items.AddRange(county);

            RefreshChart();
        }