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>();
}
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.
Available in LIB version 2017.3.1113, it will be also available in the R1 2018 Release.
UPDATE: The issue occurs in both cases - when populating with data manually and through DataProvider. We will be able to provide a fix for the DataProvider case, as well as the manual popupating if you use TextBox for editor. If populating manually and you need to use a different editor such as DateTimePicker for example, you will need to handle its background on creation.
If you create a custom editor in the EditorNeeded event or method override, and don't set the editor's value, an exception is thrown. Reproducible only with DataProvider. To work this around set the custom editor's initial value to a value different than null. Or you can use the events instead of DataProvider.