When using DataGridView.AutoGenerateColumns = True, the boolean property of bound object is updated fine, but not when I add columns manually. Values remain False.
Are there some parameters I need to set when adding the DataGridViewCheckBoxColumn? It seems not to be sufficient to set the .DataPropertyName.
I see it has some other properties like .TrueValue, .FalseValue etc, but not sure what they are for?
Or do I need to write some type of custom CellFormatting/CellValidating events?
EDIT:
I add column by extension method:
<Extension()> _
Public Sub AddCheckBoxColumn(ByVal dgv As DataGridView, ByVal propertyName As String, ByVal colName As String, ByVal fillWeight As Integer)
Dim col As New DataGridViewCheckBoxColumn(False)
col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
col.HeaderText = colName
col.Name = colName
col.Width = fillWeight
col.DataPropertyName = propertyName
dgv.Columns.Add(col)
End Sub
Found my mistake. Had an incomplete extension method with the same name in a different library. So it did not use the method I was changing.