private void CargaLotes() { if ((string)cmbFinca.SelectedValue != null) { cmbLote.IsEnabled = true; btnInfoLote.IsEnabled = true; DataClasses1DataContext dc = new DataClasses1DataContext(); foreach (SIGEEA_spObtenerFincasResult f in listaFincas) { if (f.Codigo_Finca == (string)cmbFinca.SelectedValue) { listaLotes = dc.SIGEEA_spObtenerLotes(f.PK_Id_Finca).ToList(); } } foreach (SIGEEA_spObtenerLotesResult l in listaLotes) { cmbLote.Items.Add(l.Codigo_Lote); } } }