Romain

Romain

  • NA
  • 76
  • 39.9k

Create a DataGridViewCheckBoxCell in a DataGridView

May 21 2014 11:16 AM
Good morning,
 
I contact you because I have a problem in my C# program.
I am using a basic DataGridView with 4 DataGridViewTextBoxColumn. And I would like to add a checkbox with a label in a specific cell of the data grid view at a specific position in the data grid view ( for example : Row[0], Col[0] )
 
I tried to do that :
DataGridViewCell ch1 = new DataGridViewCheckBoxCell(); 
this.dataGridView1.Rows[0].Cells[0] = ch1;
 
But it is not working and I have an exception concerning the type of the cell when I run the application.
First, I would like to know it the thing that I want to do is possible and then if someone have an idea to it.
 
Thank you in advance.

 
 
 
 

Answers (2)