Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1890
Focus issue with EditModeValidationError in DataGrid
posted

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?

Parents Reply Children