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>();
}
I have an application that uses docking. Each pane contain a virtual grid.
If the user toggles between panes, any future font size changes are not reflected by the virtual grid
I have attached a demo project that shows the problem.
After launching the application:
1) click the Increase/Decrease Font buttons to see the font size change.
2) click tab2 then go back to tab1
3) click the Increase/Decrease Font buttons to see the Virtual Grids font size no longer updates.
(I have a third virtual grid outside of the Docking that shows that the font does change if not used inside of a docking control)
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.
Thanks,