public void Edit(int id) { var model = localDb.GetById(id); if (model != null) { UserView userView = new UserView(model); var result = userView.ShowDialog(); if (result.Value) { var newmodel = GridModelList.FirstOrDefault(x => x.Id.Equals(id)); if (newmodel != null) { newmodel.Name = model.Name; } } } }