How to tell if the entire row in DataGrid selected,
or only a single column
(by Binding or Command, I want to keep the principle of MVVM).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Finally, I found a solution by myself.
(Very Strange that I found nothing about it in a good search.)
Here’s what I did:
I put to two events of the DataGrid bind to Commands sitting in ViewModel.
In the view model i invok two functions to the commands:
If CurrentCellEdit is greater than 0 sign that line editing, otherwise not.
The row number I have on SelectedIndex, and according to the CurrentCellEdit I also know which column editing in the row.
I was hoping to find a simpler way, but this is the only solution that came to mind, to keep the principle of MVVM, and I’m still trying ..