Unplanned
Last Updated: 29 Mar 2016 11:45 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 14 Aug 2015 11:24
Category: CommandBar
Type: Bug Report
0
FIX. RadCommandBar - adding a shortcut to CommandBarButton prevents the Validating event of the Form.Controls from firing
To reproduce:
1. Add a RadCommandBar with a CommandBarButton.
2. Add a RadDateTimePicker, a RadMultiColumnComboBox, a ComboBox, a DateTimePicker. Subscribe to their Validating event.
3. Add a shortcut for the CommandbarButton:

Me.CommandBarButton1.ShowKeyboardCues = True
Me.CommandBarButton1.UseMnemonic = True
Me.CommandBarButton1.Shortcuts.Add(New RadShortcut(Keys.Alt, Keys.F))

Note that when you focus one of the added controls in 2. and press Alt+F, the CommandBarButton.Click event is fired, but the Validating event for the previously focused control is not fired. This behavior is not observed for RadButton for example.

Workaround:

Public Class Form1

    Protected Overrides Function ProcessCmdKey(ByRef msg As Message, keyData As Keys) As Boolean
        Select Case keyData
            Case (Keys.Alt Or Keys.F)
                CommandBarButton1.Focus()
                CommandBarButton1.PerformClick()
                Exit Select

        End Select
End Class
0 comments