private void dgvDomicilios_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { formDomi = new DomicilioForm(this.iDUser); formDomi.ShowDialog(); ReLoadDgvDomicilio(formDomi); formDomi.Close(); }
private void btnAddDomicilio_Click(object sender, EventArgs e) { formDomi = new DomicilioForm(); formDomi.ShowDialog(); if (formDomi.ActiveControl.Text != "Cancelar") { ReLoadDgvDomicilio(formDomi); } formDomi.Close(); }
private void ReLoadDgvDomicilio(DomicilioForm FD) { var li = new List <Direccion>(); var dataList = dgvDomicilios.DataSource as List <Direccion>; if (dgvDomicilios.DataSource != null) { foreach (var domi in dataList) { li.Add(domi); } li.Add(FD.GetDomicilioIngresado()); } else { li.Add(FD.GetDomicilioIngresado()); } dgvDomicilios.DataSource = li; FormatDGV(); }