Skip to content

Selecting a row when clicking a command button in DataGrid #2943

Answered by David-Moreira
JMoodyUMC asked this question in Q&A
Discussion options

You must be logged in to vote

Ahh I think I've got it.
You're trying to do "contextual validation". So, basically Validator only gives you access to the value being validated, Validator does not access the context (Item being edited) unless you have it in memory (Selected Row).

So I see two ways for you to solve this:
1 - For contextual validations, bind to the RowUpdating Eventcallback, and you will have access to the
CancellableRowChange<TItem, Dictionary<string, object>> where you will have the original state of the Item and a dictionary of the Values that have now been edited. You can do additional validation here, and if it fails, you can cancel the row update.

2 - Actually make the Edit Button, Select the Row so…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@David-Moreira
Comment options

@stsrki
Comment options

@David-Moreira
Comment options

@JMoodyUMC
Comment options

Comment options

You must be logged in to vote
2 replies
@RealityMasque
Comment options

@RealityMasque
Comment options

Answer selected by David-Moreira
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants