Generous FS

Generous FS

  • NA
  • 38
  • 1.4k

DataGridViewCheckBoxCell cant be unchecked ?!

Aug 25 2017 1:27 PM
this.dgv_configCH.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgv_configCH_CellClick_1)
private void dgv_configCH_CellClick_1(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex > -1)
{
if ( e.ColumnIndex == 1 )
{
string l_tmpMode = _model_Channel;
_model_Channel = "";
string l_value = dgv_configCH[e.ColumnIndex, e.RowIndex].Value.ToString();
int l_xch = e.RowIndex + 1;
if (l_value == "True")
{
_producer.RunCmd("En:" + l_xch.ToString() + ",0");
// dgv_configCH[e.ColumnIndex, e.RowIndex].Value = false;
}
else if (l_value == "False")
{
_producer.RunCmd("En:" + l_xch.ToString() + ",1");
// dgv_configCH[e.ColumnIndex, e.RowIndex].Value = true;
}
_model_Channel = l_tmpMode;
}
}
}
 
I tried all the other events(dirty cell, mouseup,...) No one works. I'm on this problem for about 12 hours. Please help please please please help. I'm dying. I just want this checkbox to work normally omg. 

Answers (4)