private void OnPageDown(object obj)
{
var dataGrid = obj as SfDataGrid;
if (dataGrid.SelectedIndex > -1)
{
var key = Key.PageDown;
if (dataGrid.SelectionController == null || dataGrid.SelectionController.CurrentCellManager == null || dataGrid.SelectionController.CurrentCellManager.CurrentCell == null)
return;
var targetElement = dataGrid.SelectionController.CurrentCellManager.CurrentCell.ColumnElement as GridCell;
var routedEvent = Keyboard.PreviewKeyDownEvent;
targetElement.RaiseEvent(new KeyEventArgs(Keyboard.PrimaryDevice, PresentationSource.FromVisual(targetElement), 0, key) { RoutedEvent = routedEvent });
}
}
private void OnPageUP(object obj)
{
var dataGrid = obj as SfDataGrid;
if (dataGrid.SelectedIndex > -1)
{
var key = Key.PageUp;
if (dataGrid.SelectionController == null || dataGrid.SelectionController.CurrentCellManager == null || dataGrid.SelectionController.CurrentCellManager.CurrentCell == null)
return;
var targetElement = dataGrid.SelectionController.CurrentCellManager.CurrentCell.ColumnElement as GridCell;
var routedEvent = Keyboard.PreviewKeyDownEvent;
targetElement.RaiseEvent(new KeyEventArgs(Keyboard.PrimaryDevice, PresentationSource.FromVisual(targetElement), 0, key) { RoutedEvent = routedEvent });
}
} |