RadSyntaxEditor, while inside of a virtualized RadGridView, stealings focus immediately upon loading. It appears to do this automatically and there is no configuration to disabling. Meaning when scrolling in a RadGridView with virtualized rows, when a row with the RadSyntaxEditor materializes it will automatically steal focus from other elements.
This can be worked around using custom behavior that discards the first preview keyboard focus event that it receives.
private void onPreviewGotKeyboardFocus(object s, KeyboardFocusChangedEventArgs e)
{
if (!this.SuppressAutoFocus || _wasFocusSuppressed)
{
return;
}
_wasFocusSuppressed = true;
e.Handled = true;
}The offending line of code is this in RadSyntaxEditor.InitActiveEditorPresenter:
if (flag)
{
base.Dispatcher.BeginInvoke((Action)delegate
{
Focus();
});
}Request: Add a dependency property to allow opting-out of this default behavior. The above workaround works, but is a bit hacky for something that should probably be built-in.