Cannot check/uncheck DataGridViewCheckBoxCell?

Z

zlf

Hi,
After setting DataGridViewCheckBoxColumn's TrueValue and FalseValue, I found
I assign either TrueValue or FalseValue to a DataGridViewCheckBoxCell, it
will be checked. What is the problem? How can I control its status like
CheckBox#Checked? Thx
 
F

Felix L

Set the properties of datagridviewcheckboxcell

TrueValue = 1;
FalseValue = 0;

To check / uncheck the checkbox cell:

DataGridView1.Rows[rowIndex].Cells[colName].Value = 0 //uncheck

DataGridView1.Rows[rowIndex].Cells[colName].Value = 1 //check
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top