0

I contact you because I have a problem in my C# program.

I am using a basic DataGridView with four DataGridViewTextBoxColumn. And I would like to add a checkbox with a label in the first cell of the data grid view at the position Row[0]/Column[0].

I try this :

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.

I would like to know if the thing that I want to do is possible ? By which way ?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Zaraki21
  • 21
  • 1
  • 4
  • I have edited your title. Please see, "[Should questions include “tags” in their titles?](http://meta.stackexchange.com/questions/19190/)", where the consensus is "no, they should not". – John Saunders May 21 '14 at 14:44
  • you will have to create a DataGridViewCheckBoxColumn instead of DataGridViewTextBoxColumn if you want checkboxes – PrfctByDsgn May 22 '14 at 11:23

0 Answers0