I can imagine that you do not want your bindingSource to know what it is attached to. In the end, not because you created a bindingSource: so that it can be attached to anything.
So you do not want to know how the value of your current element is; you only want to know that it has been changed.
To do this, you use the BindingSource.CurrentItemChanged event: any method is used to change data, you receive a notification.
The view associated with the BindingSource should inform the BindingSource that the change of value is complete; editing the property is over.
In your case, the view is a DataGridView. The DataGridView tells BindingSource that the current cell has completed the change using DataGridView.EndEdit ().
Usually, when you print a cell, editing ends when the cell loses focus, or when you press esc. This gives you the opportunity to correct input errors or cancel editing if you do not want changes.
However, in the case of a DataGridViewCheckBoxCell, most people expect to finish editing as soon as they click on a DataGridviewCheckBoxCell.
So you need to handle the DataGridView.CurrentCellDirtyStateChanged event
// Whenever a DataGridViewCheckBoxCell becomes dirty editing is finished: private void OnCurrentCellDirtyChanged(object sender, EventArgs e) { if (this.dataGridView1.CurrentCell is DataGridViewCheckBoxCell; { this.dataGridView1.EndEdit(); } }
This will throw the BindingSource.CurrentItemChanged event
source share