I have the following code inside the Itemchecked event:
private void lsvRecebeGrupoLayout_ItemChecked(object sender, ItemCheckedEventArgs e)
{
Layout lay = new Layout();
GrupoLayout grupo = new GrupoLayout();
RepositorioGrupoLayout rgl = new RepositorioGrupoLayout();
RepositorioLayout repolay = new RepositorioLayout();
int idcbo = Convert.ToInt32(cboCarregaGrupo.SelectedValue);
foreach (ListViewItem x in lsvRecebeGrupoLayout.CheckedItems)
{
int idlayout = Convert.ToInt32(x.SubItems[0].Text);
lay = repolay.ConsultaPorId(idlayout);
grupo.Id = idcbo;
lay.GrupoLayout = grupo;
if (x.Checked)
{
repolay.Alterar(lay);
}
}
}
When the checkbox is clicked it makes a change in the bank and remains checked. How could I do that when the same checkbox that was clicked performs another operation as soon as it receives another click? That would remove the markup.