Completed
Last Updated: 11 Feb 2021 13:54 by ADMIN
Release LIB 2021.1.215
Maria
Created on: 28 Oct 2020 07:19
Category: UI for WPF
Type: Bug Report
1
RadVirtualGrid.ScrollRowIndexIntoViewAsync throws NullReferenceException

Sometimes RadVirtualGrid.ScrollRowIndexIntoViewAsync throws NullReferenceException.

 

Inside RadVirtualGrid.ScrollRowIndexIntoViewAsync the following method invoked:

this.MainPanel.ScrollRowIndexIntoViewInternal and this.MainPanel is Null, since RadVirtualGrid.Refresh() that was called previously makes MainPanel Null.

The Refresh method is public, so could be called anytime by mistake or not.

So, please fix one of those or even maybe both:

Refresh should not set MainPanel to Null.

Inside RadVirtualGrid.ScrollRowIndexIntoViewAsync check that this.MainPanel is not Null like you perform this check in most RadVirtualGrid methods.

 

Thank you in advance.

Maria Adamsky.

 

3 comments
ADMIN
Dilyan Traykov
Posted on: 02 Nov 2020 15:08

Hello Maria,

Thank you very much for the updated project and detailed description of your scenario.

I ran the project for a while, however, I'm also unable to observe the exception. Nonetheless, I'm adding all of this information along with the project to the internal item in our backlog so we can keep it in mind when investigating a fix.

It would, however, be of help if you could actually isolate the exception as simply adding a null-check would not be the best approach in this case as this way the scrolling may not work as expected in the same scenario. With the particular setup in mind, we might be able to come up with a more viable fix.

Once again, thank you for your valuable feedback, and let us know if you manage to isolate the exception.

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Maria
Posted on: 29 Oct 2020 15:56

Hi Dilyan,

Thank you for quick response first of all.

I tried to update you project to simulate the scenario and it's not reproduced.

But in our case it also happens once in a while, so maybe if you'll try to execute this small app for long time release compiled maybe some day the crash will occur. My guess, it's issue of timing.

I'll try to describe what complexity we have in our project, maybe it will help you to understand when the crash could happen.

First of all our VitualGrid uses custom DataProvider.

The view model knows this DataProvider and accesses the virtual grid via DataProvider.ParentGrid.

View model has 2 DispatcherTimers:

- The first one monitors logs that shown in VirtualGrid and on its tick (every 1 sec) calls DataProvider to refresh its data.

- The second one on its tick (every 1 sec) scrolls to the last line in the log and sets this line as selected on ScrollFinishedCallback.

For additional, view model  subscribed to some events(we use Prism events platform) and on their handling it calles via DataProvider: DataSource.Clear() and

          

ParentGrid.UnselectAll();

ParentGrid.Reset();

ParentGrid.SelectedIndex = -1;

methods

For additional, view model implements filtering and search functionalities, but the crash happens only when ScrollRowIndexIntoViewAsync executed every second (we call it tailing mode) and in between the file replaced and all described above.

Let me know if it helped you to understand or recreate the scenario.

Otherwise, I'll try to find some time and create a small isolated project with the full flow I described.

For a while, I removed a call to ParentGrid.Reset called from DataProvider and added try catch pattern around ScrollRowIndexIntoViewAsync call. But still I'd like to assure you that lack of null check on this.MainPanel.ScrollRowIndexIntoViewInternal inside RadVirtualGrid could be an issue sometimes.

Thank you and best regards,

Maria Adamsky.

 

ADMIN
Dilyan Traykov
Posted on: 29 Oct 2020 13:43

Hello Maria,

Thank you very much for the feedback.

We can agree that there is room for improvement in this API so I have now logged this bug report in our internal backlog so we can prioritize it. You will get notified about any changes in its status. As a thank you for bringing this to our attention, I've awarded you with some Telerik points.

In the meantime, would you find it possible to isolate this exception in a small sample project so that we can test this while working on a fix? I tried to do so at my end, however, I'm unable to reproduce the crash by calling the Reset and ScrollRowIndexIntoViewAsync methods consecutively. If you're able to, you can modify the project so that the exception is exhibited and send it back to me.

Thank you in advance for your cooperation on the matter.

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.