Click here to Skip to main content
16,008,075 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good morning,

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 a specific cell of the data grid view (for example in the cell at the position Row[0]-Column[0]).

I try this :

C#
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 and if someone have an idea to do that.

Thank you in advance.
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900