I have a datagridview table that is populated by using a datatable as a datasource. The datagridview has been set to edittable and I can change the values of cells but of course, the changes do not reflect in the original database table since the grid view is not directly bound. Is it possible to have the datagridview in such a way that when I press enter (when editting a cell), the focus shifts to the cell on the right (rather then selecting the row below)? This would need to keep on going until I reach the right most column, in which case the following edit cell would be the first cell in the following row.
Thanks in advance!
Best Answer
Try this:
define a flag
flag_edited
that will be raised when an edit occurs (CellEndEdit
event)define a function
changeSelectionToNextCell
that will undo default behavior's selection change (SelectionChanged
event)Here is a sample: