Completed
Last Updated: 19 Feb 2018 15:05 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 02 May 2016 09:23
Category: VirtualGrid
Type: Bug Report
0
FIX. RadVirtualGrid - NullReferenceException when pressing PageDown/PageUp keys after the grid is loaded
A newly created grid has its CurrentCell property initialized to Nothing. Pressing [PageDown] or any other key that causes scrolling will crash.

Steps to Reproduce:
1. Launch application
2. Press [PageDown]

 Sub New() 
        InitializeComponent()

        Me.RadVirtualGrid1.ColumnCount = 50
        Me.RadVirtualGrid1.RowCount = 100
        AddHandler Me.RadVirtualGrid1.CellValueNeeded, AddressOf RadVirtualGrid1_CellValueNeeded
    End Sub

    Private Sub RadVirtualGrid1_CellValueNeeded(sender As Object, e As Telerik.WinControls.UI.VirtualGridCellValueNeededEventArgs)
        e.Value = e.ColumnIndex
    End Sub

Workaround: 

Me.RadVirtualGrid1.CurrentCell = New Telerik.WinControls.UI.VirtualGridCellInfo(0, 0, Me.RadVirtualGrid1.MasterViewInfo)
2 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 19 Feb 2018 15:05
Hello Anujith,

Initially, RadVirtualGrid doesn't have a current cell. In the Load event of the Form, you can set the CurrentCell property to the first cell. Note that this issue has already been addressed. Feel free to upgrade in order to benefit from the fix.
Anujith
Posted on: 26 Oct 2017 05:02
where to place workaround code