private void RadComboBox_PreviewKeyUp(object sender, KeyEventArgs e)
{
try
{
var obj = (RadComboBox)sender;
if (!e.Key.Equals(Key.Enter) && !e.Key.Equals(Key.Tab))
obj.IsDropDownOpen = true;
}
catch (PresentationException)
{
throw;
}
catch (Exception ex)
{
throw new PresentationException(ex);
}
}
private void RadComboBox_KeyDown(object sender, KeyEventArgs e)
{
RadComboBox radCmb = sender as RadComboBox;
if (e.Key == Key.Tab)
{
if (Keyboard.PrimaryDevice != null && Keyboard.PrimaryDevice.ActiveSource != null && radCmb.IsHighlighted)
{
if (radCmb.IsDropDownOpen)
{
var e1 = new KeyEventArgs(Keyboard.PrimaryDevice, Keyboard.PrimaryDevice.ActiveSource, 0, Key.Enter) { RoutedEvent = Keyboard.KeyDownEvent };
InputManager.Current.ProcessInput(e1);
e1.Handled = true;
}
radCmb.KeyDown -= RadComboBox_KeyDown;
var e2 = new KeyEventArgs(Keyboard.PrimaryDevice, Keyboard.PrimaryDevice.ActiveSource, 0, Key.Tab) { RoutedEvent = Keyboard.KeyDownEvent };
InputManager.Current.ProcessInput(e2);
e2.Handled = true;
radCmb.KeyDown += RadComboBox_KeyDown;
e.Handled = true;
}
}
}