Winform datagridview selection is wrong after editing.
- by jparram
I am using a winform datagridview. The datagridviews datasource is a binding source. The gridview is using the CellEndEdit event to update the datasource. The datasource gets updated and the follwing property is set:
public List<Collection> Collections
{
set
{
this.SubjectCollectionDOBindingSource.DataSource = value;
}
}
If I end the cell editing with the 'enter' key, all works as expected. If I end the edit by clicking another cell, the data is updated as expeceted but subsequent clicks on cell columns do not correspond with the highlighted cell: ie the highlighted cell is the previously clicked cell.
What steps are considered best practice when updating a gridview so that when all is said and done it is in the desired state?