private void cboListaCantones_SelectedIndexChanged(object sender, EventArgs e) { if (cboListaCantones.SelectedValue == null || cboListaCantones.SelectedValue.GetType() != typeof(int)) { return; } var selectedDistritos = commB.FindDistritoByIdCanton(Convert.ToInt32(cboListaCantones.SelectedValue.ToString())); cboListaDistritos.DataSource = selectedDistritos; }