To work this around, you can disable the default behavior that happens on right click and then implement custom one from scratch. To do so, you can use the PreviewKeyDown event of RadVirtualGrid.
private void VirtualGrid_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
var virtualGrid = (RadVirtualGrid)sender;
if (e.Key == System.Windows.Input.Key.Right)
{
var currentCell = virtualGrid.CurrentCellInfo;
var newCellIndex = Math.Min(currentCell.ColumnIndex + 1, virtualGrid.InitialColumnCount - 1);
var nextCell = new VirtualGridCellInfo(currentCell.RowIndex, newCellIndex, vg);
virtualGrid.CurrentCellInfo = nextCell;
virtualGrid.SelectedCells.Clear();
virtualGrid.SelectedCells.Add(nextCell);
var viewportWidth = this.panel.ViewportWidth - virtualGrid.RowHeaderWidth;
var newCellX = (virtualGrid.ColumnWidth * nextCell.ColumnIndex) - this.panel.HorizontalOffset;
if (newCellX >= viewportWidth)
{
var delta = virtualGrid.ColumnWidth + (newCellX - viewportWidth);
this.panel.SetHorizontalOffset(this.panel.HorizontalOffset + delta);
}
e.Handled = true;
}
}
private VirtualGridCompoundPanel panel;
private void VirtualGrid_Loaded(object sender, RoutedEventArgs e)
{
var virtualGrid = (RadVirtualGrid)sender;
this.panel = virtualGrid.FindChildByType<VirtualGridCompoundPanel>();
}
Currently, to modify the default appearance of the cells you can use the CellDecorationsNeeded event of RadVirtualGrid. The event args exposes a predefined set of properties that can be applied onto the cell. However, there is no text alignment.
Introduce a cell text alignment property in the event args similar to the CellTextAlignment of the RadVirtualGrid itself.
This component will have the goal to achieve fast operations when dealing with millions of records from a data source. This should be accomplished by decoupling the UI logic from data management operations like loading, filtering, sorting and grouping which should be delegated to the server. Since the grid will not have ItemsSource property, the developer will be responsible for managing the data to/from the server through a given events. Official version of RadVirtualGrid is available from R3 2017 Release of UI for WPF. Check what's new in R3 2017 here: http://www.telerik.com/support/whats-new/wpf/release-history/ui-for-wpf-r3-2017
VirtualGridCellClipboardEventArgs.Cell.ColumnIndex is off by 1 if you pin a column to the left.
Same with VirtualGridCellClipboardEventArgs.Cell.RowIndex if you pin a column to the top.