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

Alternating rows hurts performance

10 Answers 81 Views
GridView
This is a migrated thread and some comments may be shown as answers.
OfficerJoe
Top achievements
Rank 1
OfficerJoe asked on 14 Jul 2011, 06:56 PM
Hello,

I am evaluating these controls for my company and so far have been impressed overall. This week, however, I have run into a performance issue that I have not been able to resolve so far:

I am using the 2011 Q2 RadGridView (have also tried Q1) with data virtualization using a VirtualQueryableCollectionView talking to a WCF service. UI virtualization is on and working properly. I am not using any custom grid, row, or column styles or templates. As soon as I turn on row alternation using AlternationCount = 2, the vertical scroll performance becomes terrible.

When alternation is off: holding down the "scroll down" thumb scrolls smoothly even as new pages of data arrive and are loaded into the grid.
When alternation is on: holding down the "scroll down" thumb scrolls smoothly until a page of data arrives; then, the scrolling locks up for a second while the items are loaded into the grid. Reducing the number of items per "page" doesn't affect it (I even tried only loading 1 row at a time).

Does anyone know of an alternative way to set alternating row background colors that actually performs at a usable level?

Thank you,
Joseph

10 Answers, 1 is accepted

Sort by
0
Accepted
Pavel Pavlov
Telerik team
answered on 19 Jul 2011, 02:35 PM
Hello Officerjoe,
This is a know issue. Setting an alternation requires additional handling especially regarding  operations affecting the count and the order of items - thus the performance hit. We are planning improvements on that for our next official release.
Meanwhile I  would recommend the following workaround - Please use row style selectors to achieve a similar effect.

All the best,
Pavel Pavlov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
OfficerJoe
Top achievements
Rank 1
answered on 22 Jul 2011, 05:38 PM
Hello Pavel,

Thanks for the workaround. I was able to achieve alternating row background colors using that method, with much better performance than using the built in alternation functionality.

Thanks,
Joseph
0
Antti
Top achievements
Rank 1
answered on 28 Oct 2011, 09:34 AM
Hi,

Could you please inform me on the status of this issue. Is there an official fix coming?

I cannot find this topic from the fixed issues list of the release history either in Q2 2011 SP1 or Q3 2011 BETA.

Regards,
Antti
0
Pavel Pavlov
Telerik team
answered on 28 Oct 2011, 09:52 AM
Hello Antti,

For the time being the workaround suggested bellow is still the recommended approach .

Best wishes,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Antti
Top achievements
Rank 1
answered on 28 Oct 2011, 09:57 AM
Hi Pavel,

Thank you for the quick answer.

Antti
0
Antti
Top achievements
Rank 1
answered on 03 Nov 2011, 08:13 AM
Hi,

If we use the style selector approach we get a bit better performance than with the alternation count approach. However, there is still some lag when scrolling.

We use row index to decide if the row in question is an even or odd row. Thus, in the style selector we currently use this code to get the index of the row:
var index = grid.Items.IndexOf(item);

That  seems to be the performance bottle neck. Is there any faster way to get the index or other way to know if the row index is even or odd? There is the IsAlternate property but setting the AlternationCount on is the reason for the original performance problems.

Regards,
Antti
0
Pavel Pavlov
Telerik team
answered on 07 Nov 2011, 04:42 PM
Hello Antti,

What is the type of the Item ? Can you put an additional property inside ?  The getter of that property should be faster than the index of .
I can not think of a better approach so far.

Regards,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Antti
Top achievements
Rank 1
answered on 21 Nov 2011, 12:19 PM
Hello,

We haven't been able to bypass the performance problems with this solution as we cannot add new properties to data items. We consider using grid without virualization.

Regards, Antti
0
Thomas
Top achievements
Rank 1
answered on 08 Oct 2017, 04:39 AM

Is there any update on this? I have the exact same problem.

Disable "RowVirtualization" isn't an option, considering the resulting performance loss.

I did implement my own StyleSelector (as recommended here). However, the performance is still really bad. (While binding to more than 5k items)

0
Ivan Ivanov
Telerik team
answered on 12 Oct 2017, 04:20 AM
Hello,

Let us continue the commucnication in the other thread, where you have shared more specific information about you scenario. I will answer there a bit later today. As soon as we bring the topic to conclusion, I will copy the final posts here fore better visibility to the community.

Regards,
Ivan Ivanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
OfficerJoe
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
OfficerJoe
Top achievements
Rank 1
Antti
Top achievements
Rank 1
Thomas
Top achievements
Rank 1
Ivan Ivanov
Telerik team
Share this question
or