I have a check in the DataGridView, I wanted to know if it is possible that every time a value is added it automatically appears as checked
I have a check in the DataGridView, I wanted to know if it is possible that every time a value is added it automatically appears as checked
It can be done, of course. First, you could control each time a new row is added by
DataGridView
handling the eventRowsAdded
and then set the cell value of the typeDataGridViewCheckBoxColumn
like this:But beware, if you
DataGridView
had previous data, you would first save the number of existing records in a variable and check that the new index was greater than that number, or else you would mark all the CheckBoxes.