private void btnRemoverProfissao_Click(object sender, RoutedEventArgs e)
{
if (agDataGrid3.SelectedRowsCount != 0)
{
PESSOA_PROFISSAO profissao = (PESSOA_PROFISSAO)DataGrid.FocusedDataRow;
PessoaProfissaoGrupo.PESSOA_PROFISSAO.Remove(profissao);
Profissoes.Remove(profissao);
}
else
MessageBox.Show("Select a Profession to remove.");
}
private void CancelButton_Click(object sender, RoutedEventArgs e)
{
_em.RejectChanges();
this.DialogResult = false;
}
The above code in Child Window I click remove then click on cancel.
(I am not executing _em.saveAsync())
Then I move to other menu and doing other operation like saving other records
and _em Executing PessoaProfissaoGrupo.PESSOA_PROFISSAO.Remove(profissao); this records
I expect after i cancel _em should be reject my changes.
Thanks