Winform datagridview selection is wrong after editing.

Posted by jparram on Stack Overflow See other posts from Stack Overflow or by jparram
Published on 2010-06-07T20:40:18Z Indexed on 2010/06/07 20:42 UTC
Read the original article Hit count: 207

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms