Hi Brian,
You will need to define two separate keyboard command providers - one for the parent grid and one for those defined in RowDetails. The implementation could look similar to:
public class ParentGridCustomKeyboardCommandProvider : DefaultKeyboardCommandProvider
{
public ParentGridCustomKeyboardCommandProvider(GridViewDataControl grid)
: base(grid)
{
Grid = grid;
}
private GridViewDataControl Grid{get;set;}
public override IEnumerable<
ICommand
> ProvideCommandsForKey(Key key)
{
List<
ICommand
> commandsToExecute = base.ProvideCommandsForKey(key).ToList();
if (key == Key.PageDown)
{
commandsToExecute.Clear();
commandsToExecute.Add(RadGridViewCommands.MoveDown);
commandsToExecute.Add(RadGridViewCommands.SelectCurrentUnit);
}
return commandsToExecute;
}
}
public class ChildGridCustomKeyboardCommandProvider : DefaultKeyboardCommandProvider
{
public ChildGridCustomKeyboardCommandProvider(GridViewDataControl grid)
: base(grid)
{
Grid = grid;
}
private GridViewDataControl Grid{get;set;}
public override IEnumerable<
ICommand
> ProvideCommandsForKey(Key key)
{
List<
ICommand
> commandsToExecute = base.ProvideCommandsForKey(key).ToList();
if (key == Key.PageDown)
{
commandsToExecute.Clear();
var parentGrid = Grid.ParentOfType<
GridViewDataControl
>();
if (parentGrid != null)
{
parentGrid.Focus();
var moveDownCommand = RadGridViewCommands.MoveDown as RoutedUICommand;
var selectCurrentItemCommand = RadGridViewCommands.SelectCurrentUnit as RoutedUICommand;
moveDownCommand.Execute(null, parentGrid);
selectCurrentItemCommand.Execute(null, parentGrid);
}
}
return commandsToExecute;
}
}
I am attaching a sample project that you can use for testing the implementation as well.
Is that the behavior that you require ?
Kind regards,
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>