private void SoportesForm_Load(object sender, EventArgs e) { this.Dock = DockStyle.Fill; try { lista = servicio.GetLista(); MostrarDatosEnGrilla(); } catch (Exception exception) { MessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static void CargarDatosComboSoportes(ref ComboBox combo) { IServicioSoporte servicio = DI.Create <IServicioSoporte>(); var lista = servicio.GetLista(); Soporte defaultSoporte = new Soporte() { SoporteId = 0, Descripcion = "<Seleccione Soporte>" }; lista.Insert(0, defaultSoporte); combo.DataSource = lista; combo.DisplayMember = "Descripcion"; combo.ValueMember = "SoporteId"; combo.SelectedIndex = 0; }