private void button1_Click(object sender, EventArgs e) { Location temp = new Location(); frmLocationDetails frm = new frmLocationDetails(ref temp, true); Utils.ShowForm(this, frm, dgvLocation, () => { //Refresh list locations = Loc.Select(); loc = new AggregatedPropertyBindingList <Loc>(locations); dgvLocation.DataSource = loc; }); }
private void dgvLocation_CellClick(object sender, DataGridViewCellEventArgs e) { int id = (int)dgvLocation.Rows[e.RowIndex].Cells["Id"].Value; Location temp = null; var q = from c in locations where c.Id == id select c; temp = q.First(); frmLocationDetails frm = new frmLocationDetails(ref temp); Utils.ShowForm(this, frm, dgvLocation, () => { //Refresh list locations = Loc.Select(); loc = new AggregatedPropertyBindingList <Loc>(locations); dgvLocation.DataSource = loc; }); }