This is a migrated thread and some comments may be shown as answers.

ScrollIntoViewAsync is acting very slowly

4 Answers 65 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Francois Lamy
Top achievements
Rank 1
Francois Lamy asked on 05 Mar 2013, 09:12 PM
I am using version 2012.1.326 of the controls and I am seeing some extremely slow response times when I call ScrollIntoViewAsync.  I am using Asynchronous DataLoadMode, Deferred ScrollMode, and I am using EnableRowVirtualization.  I have 1000 items in my grid, and I have the CurrentItem property bound to a Record in my View Model, which also holds an ObservableCollection<Record> that I use as the ItemsSource for the RadGridView.

Whenever the CurrentItem property changes on my View Model, I call ScrollIntoViewAsync() and pass that record in.  When I am at the top of the records (i.e. showing about records 1 - 20) and move to the last record, it takes a second or two to respond before it scrolls to the bottom.  Then, if I immediately try to scroll the top record into view, it can take up to 10 seconds to actually perform the scroll after successfully setting the CurrentItem property on my View Model.

Anyone else seeing this kind of lag when using ScrollintoViewAsync?

4 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 06 Mar 2013, 09:01 AM
Hello,

Actually using the DataLoadMode="Asyncronous" is generally not quite recommended. Please remove it and test again. Would you please as well check if you have placed the GridView in a container that will measure it with Infinity - for example StackPanel, ScrollViewer or a Grid.Row with Height=Auto? 
 

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Francois Lamy
Top achievements
Rank 1
answered on 07 Mar 2013, 02:58 PM
Didie,

I removed the DataLoadMode Asynchronous setting, but I am still seeing laggy scroll times.  I have my table inside a control with a finite height, so only a limited number of rows are realized in the UI at once.

One thing I did notice in debugging this issue...
I call RadGridView.ScrollIntoViewAsync.
This ends up calling BeginInvoke(ScrollRowIntoViewInternal)
This ends up calling ScrollIntoViewRecursive()
When I put a tracepoint into ScrollIntoViewRecursive, it gets called over 200 times.  This SEEMS excessive... maybe I'm doing something wrong?

Thanks for your help!
0
Francois Lamy
Top achievements
Rank 1
answered on 07 Mar 2013, 03:30 PM
Didie,

I believe that I have isolated the issue.  It turns out that I was calling ScrollIntoViewAsync in response to the Loaded event for my outer UI element.  I think that this was causing ScrollIntoViewAsync to be called a second time for every time I really wanted ScrollIntoViewAsync to be invoked.  It is my guess that somehow these two calls were stomping all over each other in their attempts to perform the scroll...

Anyway, if I remove that call, everything seems to work appropriately now.  Again, thank you for your help.  Also, thank you for pointing out that the Asynchronous DataLoadMode setting is not recommended.
0
Dimitrina
Telerik team
answered on 07 Mar 2013, 06:09 PM
Hello,

I am glad to hear you have resolved the issue. 

Kind regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Francois Lamy
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Francois Lamy
Top achievements
Rank 1
Share this question
or