In DataGridView I have 1 DataGridViewCheckBoxColumn,set ThreeState=true. I want when tick into CheckBox,for one status it will export an any value in TextBox
private void grd_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
if ((grd.CurrentCell is DataGridViewCheckBoxCell) && (!grd.CurrentCell.Value.Equals(CheckState.Checked)))
{
textBox1.Text = "true value";
}
if ((grd.CurrentCell is DataGridViewCheckBoxCell) && (!grd.CurrentCell.Value.Equals(CheckState.Unchecked)))
{
textBox1.Text = "fasle value";
}
if ((grd.CurrentCell is DataGridViewCheckBoxCell) && (!grd.CurrentCell.Value.Equals(CheckState.Indeterminate)))
{
textBox1.Text = "indeterminate value";
}
}
when I debug program, its only export the last value "indeterminate value".please show me how to set status Check,Uncheck,Indeterminate is right?
binhnt