How to check a DataGridViewCheckBoxCell?
-
I have inserted a DataGridViewCheckBoxColumn in a DataGridView. But whenever I click on its DataGridViewCheckBoxCell, the box is not checked. How do I check it? Is any event needed? dgvcbc = new System.Windows.Forms.DataGridViewCheckBoxColumn(); dgvcbc.HeaderText = "Check to delete"; dgvcbc.Name = "Check to delete"; dgvcbc.CellTemplate = new DataGridViewCheckBoxCell(); dataGridView1.Columns.Insert(0, dgvcbc); Thanks!
-
I have inserted a DataGridViewCheckBoxColumn in a DataGridView. But whenever I click on its DataGridViewCheckBoxCell, the box is not checked. How do I check it? Is any event needed? dgvcbc = new System.Windows.Forms.DataGridViewCheckBoxColumn(); dgvcbc.HeaderText = "Check to delete"; dgvcbc.Name = "Check to delete"; dgvcbc.CellTemplate = new DataGridViewCheckBoxCell(); dataGridView1.Columns.Insert(0, dgvcbc); Thanks!
Hello The problem is for sure NOT in the code that you've posted. Are other columns in the DataGridView working too?!! Maybe you've set the eable to false by mistake or something. The above code should work fine!! Regards:rose:
-
Hello The problem is for sure NOT in the code that you've posted. Are other columns in the DataGridView working too?!! Maybe you've set the eable to false by mistake or something. The above code should work fine!! Regards:rose:
Hi, There is only one DataGridViewCheckBoxColumn in the DataGridView. Other columns are mainly DataGridViewColumn and DataGridViewLinkColumn. The links work perfectly. You mentioned the setting problem. What do you think has been set to false by mistake? What is the code for that setting? Thanks again.
-
Hi, There is only one DataGridViewCheckBoxColumn in the DataGridView. Other columns are mainly DataGridViewColumn and DataGridViewLinkColumn. The links work perfectly. You mentioned the setting problem. What do you think has been set to false by mistake? What is the code for that setting? Thanks again.
Hello Well, as I told you in my previous post, this code should work!! You can tamper with the settings of your DataGridView in a way that it may stop responding. I gave you an example. Check the
Enable
prpperty of your DataGidView. Also check to see if you've made this column asReadOnly
. You can check both from the property grid. When I asked about other columns, I meant are they working in any how?? Can you edit the cells??Regards:rose:
-
Hello Well, as I told you in my previous post, this code should work!! You can tamper with the settings of your DataGridView in a way that it may stop responding. I gave you an example. Check the
Enable
prpperty of your DataGidView. Also check to see if you've made this column asReadOnly
. You can check both from the property grid. When I asked about other columns, I meant are they working in any how?? Can you edit the cells??Regards:rose:
Hi, Do you mean the dataGridView.Enabled property? But it is set to true which allows user interaction. And the CheckBoxColumn isn't set to ReadOnly. So what else should I check? Thanks!
-
Hi, Do you mean the dataGridView.Enabled property? But it is set to true which allows user interaction. And the CheckBoxColumn isn't set to ReadOnly. So what else should I check? Thanks!
Hello Well, err... Yes! Forgive the typo. I mean Enabled.. I'm running out of guesses here. Try to add another CheckboxColumn, and see what happens. Also you didn't answer my question. Do other Text columns work? Can you type in them?
Regards:rose:
-
Hello Well, err... Yes! Forgive the typo. I mean Enabled.. I'm running out of guesses here. Try to add another CheckboxColumn, and see what happens. Also you didn't answer my question. Do other Text columns work? Can you type in them?
Regards:rose:
Hi, It's working now. I found out that the datagridview is readonly though I checked that the checkboxcolumn is not readonly. Anyways, thanks very much for your help.