Questions tagged [datagridviewcheckboxcell]
142 questions
24
votes
17 answers
Check/Uncheck a checkbox on datagridview
Can someone help me why it doesn't work?
I have a checkbox and if I click on it,
this should uncheck all the checkbox inside the datagridview which were checked before including the user selected checkbox.
Here is the code:
private void…

user1647667
- 1,269
- 4
- 14
- 26
18
votes
6 answers
How to check if dataGridView checkBox is checked?
I'm new to programming and C# language. I got stuck, please help. So I have written this code (c# Visual Studio 2012):
private void button2_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if…

Ruslan
- 351
- 1
- 4
- 13
15
votes
7 answers
How to verify if a DataGridViewCheckBoxCell is Checked
I have bound a data table to a DataGridView, this data table has a column called "Status" which is of type Boolean. I can set the value to true or false just fine via code.
However, I can't figure out how to check to see if the given row is…
user189442
8
votes
2 answers
Checkbox in DataGridView does not change its value after checking it
I have checkboxes in one of my columns in DataGridView.
And now I have a problem: When I click once on Checkbox it changes but only visualy, in code its value is still set to false. But if I click on Checkbox and then anywhere else on my…

Peter
- 912
- 3
- 11
- 29
8
votes
2 answers
Is there a way to make DataGridViewCheckBox Cells smaller?
As described in this question it appears the minimum row height for a row in a DataGridView (WinForm not WPF) is 17 if you wish to display check boxes in a DataGridViewCheckBoxCell. Any smaller and the check box simply disappears!
Is there a way to…

Stuart Helwig
- 9,318
- 8
- 51
- 67
7
votes
5 answers
Programatically loop through a DatagridView and check checkboxes
I have DataGridView bound by a datatable i have checkboxes to the same.
I want to navigate or loop through the the datagridview and check mark these checkboxes ,Below is the syntax i use .
foreach(DataGridViewRow dr in dgvColumns.Rows)
{
…
Francis
5
votes
1 answer
How to add checkbox and label in the same cell of datagridview?
Hi Programmers,
I need to add the checkbox and label in the same cell.I do know how to do that. I can make the datagridviewcolumn to checkbox but then it only shows the checkbox and no place to show label. Can anybody wake me up…

Prakash Kunwar
- 797
- 4
- 14
- 28
5
votes
3 answers
DataGridView column of type DataGridViewCheckBoxCell is constantly readonly/disabled
I am using a .NET Windows Forms DataGridView and I need to edit a DataBound column (that binds on a boolean DataTable column). For this I specify the cell template like this:
DataGridViewColumn column = new DataGridViewColumn(new…

Vasile Tomoiaga
- 1,727
- 3
- 16
- 19
5
votes
1 answer
Issue detecting checkbox state in DataGridView
I have a DataGridView control in a .Net application that contains a checkbox column. I would like for the user to be able to edit the checkboxes. The issue that I am running into is that I cannot detect the state of the checkbox after the user…

Mike
- 51
- 1
- 4
5
votes
5 answers
DataGridView update datasource directly after changed Checkbox value
I have a System.Windows.Forms DataGridView that is bound to a List.
The class MyObject contains a boolean property that is bound to DataGridViewCheckboxCell within the DataGridView.
public class MyObject
{
public decimal DefaultValue…

Jürgen Steinblock
- 30,746
- 24
- 119
- 189
5
votes
1 answer
DataGridView CheckBox column doesn't apply changes to the underlying bound object
I have a list of Record objects that serve as rows in my DataGridView.
Each Record has a new bool value Helped. Sure enough, this new value shows up as check mark in my form.
As it stands currently, when this box is checked it doesn't seem to…

MrDysprosium
- 489
- 9
- 20
5
votes
1 answer
DatagridView Checkbox Column is always null
I have a strange issue.
Basically I have a datagridview and a button. When I click this button it checks all rows for column 1s value - the checkbox column. It then sets it to true / false depending on what it currently is.
Thats all fine.
But then,…

Aaron Gibson
- 1,280
- 1
- 21
- 36
5
votes
8 answers
Hide some datagridview checkbox cell
I have a datagridview showing installments of a loan. I created a datagridviewcheckbox column so then I can select all the installments i want to pay for.
This is a screen of the datagrid:
My issue is that I need to disable the checkboxes of the…

Andres
- 2,729
- 5
- 29
- 60
4
votes
3 answers
C# DataGridViewCheckBoxColumn Hide/Gray-Out
I have a DataGridView with several columns and several rows of data. One of the columns is a DataGridViewCheckBoxColumn and (based on the other data in the row) I would like the option to "hide" the checkbox in some rows. I know how to make it read…

john
- 4,043
- 7
- 27
- 39
4
votes
3 answers
DataGridViewCheckBoxCell how to show checked when set during form load
I have a DataGridView that loads data from a DataTable, along with an unbound column of DataGridViewCheckBoxCells. The rows in the DataGridView are compared with a separate DataTable with values the user has saved, and if there is a match, the…

Megan
- 53
- 1
- 4