narasiman rao

narasiman rao

  • NA
  • 519
  • 768.6k

using radio button check box gets checked and unchecked

Mar 10 2013 8:18 AM
i tried my code as follows; My code as follows; private void Form1_Load(object sender, EventArgs e) { this.cb_am.TabStop = false; this.cb_pm.TabStop = false; } private void cb_am_CheckedChanged(object sender, EventArgs e) { if (cb_am.Checked) { dataGridView1.Rows[0].Cells[0].Value = true; dataGridView1.Rows[0].Cells[1].Value = true; } if (cb_am.Checked = false) { dataGridView1.Rows[0].Cells[0].Value = false; dataGridView1.Rows[0].Cells[1].Value = false; } } i tried my code, if radio button is checked the check box gets true. that is working fine. when radio button is unchecked the check box gets unchecked. the above unchecked it is not working. if (cb_am.Checked = false) { dataGridView1.Rows[0].Cells[0].Value = false; dataGridView1.Rows[0].Cells[1].Value = false; } whether the above code is correct? what is the mistake i made.please help me. Regards, rao.