Hi,
I want to disable the F2 in the DataGrid since i want use this key in a menuitem. I defined the F2 in a commandbinding in a menu, but it looks like the F2 key never arrive there if the DataGrid has the focus.
Any idea how i can solve this problem?
Thanks
I want to disable the F2 in the DataGrid since i want use this key in a menuitem. I defined the F2 in a commandbinding in a menu, but it looks like the F2 key never arrive there if the DataGrid has the focus.
Any idea how i can solve this problem?
Thanks
4 Answers, 1 is accepted
0
Hi,
Vlad
the Telerik team
Have you tried to set EditTriggers?
Best wishes,Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0

Silvan
Top achievements
Rank 1
answered on 14 Jan 2011, 10:59 AM
Yes, i set EditTriggers="None", but the F2-key still not function in menu (other keys defined in the menu like F3, etc. works without problems).
If i catch the PreviewKeyDown on the grid i can see that the F2 key was pressed, but is look like is not bubble up.
If i catch the PreviewKeyDown on the grid i can see that the F2 key was pressed, but is look like is not bubble up.
0
Accepted
Hi Marcel,
Nedyalko Nikolov
the Telerik team
Indeed RadGridView handles F2 key, since it is the default key for triggering edit mode on a current cell.
However you could override this behavior like demonstrated in this blog post.
Let me know if this doesn't help.
Nedyalko Nikolov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0

Silvan
Top achievements
Rank 1
answered on 14 Jan 2011, 05:53 PM
Thanks a lot, works perfect. And here the vb-code, if someone else need it one time:
And in the code for the grid just set:
Imports
System.Collections.Generic
Imports
Telerik.Windows.Controls
Imports
Telerik.Windows.Controls.GridView
Namespace
CustomKeyboardProvider
Public
Class
CustomKeyboardCommandProvider
Inherits
DefaultKeyboardCommandProvider
Private
parentGrid
As
GridViewDataControl
Private
defaultKeyboardProvider
As
DefaultKeyboardCommandProvider
Private
customKeyboardProvider
As
CustomKeyboardCommandProvider
Public
Sub
New
(
ByVal
grid
As
GridViewDataControl)
MyBase
.
New
(grid)
Me
.parentGrid = grid
End
Sub
Public
Overrides
Function
ProvideCommandsForKey(
ByVal
key__1
As
Key)
As
IEnumerable(Of ICommand)
Dim
commandsToExecute
As
List(Of ICommand) =
MyBase
.ProvideCommandsForKey(key__1).ToList()
If
key__1 = Key.F2
Then
commandsToExecute.Clear()
commandsToExecute.Remove(RadGridViewCommands.BeginEdit)
End
If
Return
commandsToExecute
End
Function
End
Class
End
Namespace
And in the code for the grid just set:
Me
.myGrid.KeyboardCommandProvider =
New
CustomKeyboardProvider.CustomKeyboardCommandProvider(
Me
.myGrid)