I have a datagrid that I validate the users input using the following code:
private void MainDataGrid_EditModeValidationError(object sender, EditModeValidationErrorEventArgs e)
{
e.InvalidValueBehavior = InvalidValueBehavior.RetainValue;
e.Handled = true;
}
The issue I'm having is when when the user enters something not valid the XamDialogWindow shows up but it doesn't have focus because of InvalidValueBehavior. Is there a way I can force focus to another control, I know I can use RevertValue however I don't want to revert what the usr types in. When I did research I noticed there's a method in XamDateTimeEditor called InitializeOriginalValueFromValue to help with this issue if I use RevertValue, is there something like that in the DataGrid?
Hello,
Thank you for your post. I have been looking into it and I can say that if the InvalidaValueBehavior is set to RetainValue, you are not allowed to exit edit mode if there is a validation error. Please let me know if you have further questions on this matter.
Looking forward for your reply.
If I change to RevertValue, is there a workaround to keep what the user types in like in a XamDateTimeEditor?