In my DataGridView, the user's information is included in the database, whether the user is an administrator or not, this cell has a DataGridViewCheckBoxCell.
Iwanttopassthevalue(True/False)toaCheckBoxControl.Itriedusingthefollowingcode,butitdoesnotwork.
Debugging,InoticedthatthevariableadmalwaysisTrue,eventhoughitcomesfromtheBankandtheCheckBoxevenreceivingthevalue,itisnotmarked,nothinghappens.
TheCheckBoxisbydefaultwithCheckStateIndeterminate
privatevoidtsbEditarUsuario_Click(objectsender,EventArgse){if(gridConsultaUsuario.SelectedRows.Count>0){ucEditarUsuarioeditarUsuario=newucEditarUsuario();editarUsuario.txtNome_detalhe.Text=gridConsultaUsuario.CurrentRow.Cells[0].Value.ToString();editarUsuario.txtUserCadastro_detalhe.Text=gridConsultaUsuario.CurrentRow.Cells[1].Value.ToString();editarUsuario.txtEmail_detalhe.Text=gridConsultaUsuario.CurrentRow.Cells[2].Value.ToString();editarUsuario.cboSetor_detalhe.SelectedItem=gridConsultaUsuario.CurrentRow.Cells[3].Value.ToString();editarUsuario.cboCargo_detalhe.SelectedItem=gridConsultaUsuario.CurrentRow.Cells[4].Value.ToString();varadm=(DataGridViewCheckBoxCell)this.gridConsultaUsuario.CurrentRow.Cells[5];editarUsuario.chkAdm_consulta.Checked=adm.Selected;_tabSystem.subTab(telaPrincipal.tabPrincipal.SelectedIndex,editarUsuario);}else{MessageBox.Show("Selecione um usuário");
}
}