private bool InitComboBox() { List <TIPO_FICHA> tipoFichas = acciones.ObtenerTiposFicha(); cbTipoEntradaAFM.Items.Clear(); if (tipoFichas != null) { if (tipoFichas.Count != 0) { foreach (TIPO_FICHA tipo in tipoFichas) { ComboboxItem aux = new ComboboxItem(); aux.Text = tipo.NOM_TIPO_FICHA; aux.Value = tipo.ID_TIPO_FICHA; cbTipoEntradaAFM.Items.Add(aux); } cbTipoEntradaAFM.SelectedIndex = 0; return(true); } else { return(false); } } else { return(false); } }