Hi, I am trying to change Enter key bevavior to act like Tab key. I found your documentation and blog post but these are all for the case when grid is in edit mode. My grid looks like this:
01.
<
telerik:RadGridView
Name
=
"Grid"
02.
Grid.Row
=
"1"
03.
AutoGenerateColumns
=
"False"
04.
ItemsSource
=
"{Binding Orders}"
05.
ShowGroupPanel
=
"False"
06.
RowIndicatorVisibility
=
"Collapsed"
07.
BorderBrush
=
"Black"
08.
Margin
=
"5"
>
09.
<
telerik:RadGridView.Columns
>
10.
<
telerik:GridViewDataColumn
Header
=
"Price"
Width
=
"150"
>
11.
<
telerik:GridViewDataColumn.CellTemplate
>
12.
<
DataTemplate
>
13.
<
telerik:RadNumericUpDown
Value
=
"{Binding Price, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"
SmallChange
=
"0.1"
LargeChange
=
"1"
/>
14.
</
DataTemplate
>
15.
</
telerik:GridViewDataColumn.CellTemplate
>
16.
</
telerik:GridViewDataColumn
>
17.
18.
<
telerik:GridViewDataColumn
Header
=
"Volume"
Width
=
"*"
>
19.
<
telerik:GridViewDataColumn.CellTemplate
>
20.
<
DataTemplate
>
21.
<
telerik:RadNumericUpDown
Value
=
"{Binding Volume, Mode=TwoWay, StringFormat=N2, UpdateSourceTrigger=LostFocus}"
SmallChange
=
"0.1"
LargeChange
=
"1"
/>
22.
</
DataTemplate
>
23.
</
telerik:GridViewDataColumn.CellTemplate
>
24.
</
telerik:GridViewDataColumn
>
25.
</
telerik:RadGridView.Columns
>
26.
</
telerik:RadGridView
>
And my custom keyboard command provider looks like this:
01.
public
class
CustomKeyboardCommandProvider : DefaultKeyboardCommandProvider
02.
{
03.
public
CustomKeyboardCommandProvider(GridViewDataControl grid) :
base
(grid)
04.
{
05.
}
06.
07.
public
override
IEnumerable<ICommand> ProvideCommandsForKey(Key key)
08.
{
09.
if
(key == Key.Enter)
10.
{
11.
var tabCommands =
base
.ProvideCommandsForKey(Key.Tab).ToList();
12.
13.
return
tabCommands;
14.
}
15.
16.
return
base
.ProvideCommandsForKey(key).ToList();
17.
}
18.
}
Is there a way how to do it for my case?
Thank you.
Karel