Skip to content

How to Cancel DataGrid SelectionChange - MVVM #17971

Answered by msneijders
hematec asked this question in Q&A
Discussion options

You must be logged in to vote

But when i save the changes, select another row and directly start editing in the input fields, i could change the row

Probably because the datagrid is not in editing modus here. I see you selecting the 3rd row. And then change value in a textbox outside of the datagrid. Editing that textbox will not set the datagrid into edit modus, and so event RowEditEnding will not fire (debug or trace that handler to check).

You can set the datagrid into edit modus manually using BeginEdit() (and probably manually end editing, CommitEdit() or CancelEdit()).

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@hematec
Comment options

@msneijders
Comment options

Answer selected by hematec
@hematec
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants