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

GridView with Prefetch in Virtualization?

2 Answers 111 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jan
Top achievements
Rank 1
Jan asked on 24 Jun 2019, 07:30 PM

Within my dategrid itemsource I have some properties that basically act as IValueConverters to lookup a string in a dictonary by using and int.

 Public ReadOnly Property ReifenIdHintenBezeichnung As String
            Get
                If Fahrzeug.ReifenIdHinten.HasValue Then
                    Return _reifenDict(Fahrzeug.ReifenIdHinten.Value)
                Else
                    Return String.Empty
                End If
            End Get
        End Property

these columns are bound to a datatemplate that acts as cellTemplate for a combobox like this:

<DataTemplate><TextBlock Text="{Binding ReifenIdHintenBezeichnung }" /></DataTemplate>

(the whole idea to use a value converter with a dictonary was inspired by this https://feedback.telerik.com/wpf/1352336-slow-scrolling-when-a-gridviewcomboboxcolumn-is-bound-to-a-large-dataset) but as I need to create columns dynamically, I ended up with this property (and for the truely dynamic part properties with a parameter - but that's not the issue).

I noticed that the property is called everytime I scroll down one row for the following row. so one row is cached but not the row afterwards. 

My question is if there is a way to use virtualization in such a way that say 20 rows and 10 columns are prefetched (async at best) to increase performance.

If you got any other suggestions on how to improve scolling performance with Comboboxes, i'm happy to read them. I already applied most tips mentioned here:https://docs.telerik.com/devtools/wpf/controls/radgridview/performance/tips-tricks

 

thanks for your help!

Jan

 

2 Answers, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 27 Jun 2019, 12:56 PM
Hello Jan,

Thank you for the provided code snippet. 

Firstly, please allow me to say that we have introduced some improvements in the GridViewComboBoxColumn. Namely, the IsLightweightModeEnabled property, which was introduced in R2 2016 and addresses the exact scenario described in the feedback item that you referenced. Please, give it a try and let me know how it goes. 

On a side note, I will try to elaborate a bit on the UI Virtualization mechanism of the RadGridView. As you said- "I noticed that the property is called everytime I scroll down one row for the following row. so one row is cached but not the row afterwards. ". This is due to the fact that only the containers for the GridViewRows, which are inside the viewport(and one row that is just outside the viewport) are created. After that while scrolling the containers for the rows are reused.

I hope you find this information helpful. Don't hesitate to contact us again, if you have any other questions.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Jan
Top achievements
Rank 1
answered on 27 Jun 2019, 01:07 PM

Hi Vladimir,
thank your for explaining. As I understood it now the time for querying data from an observable collection is in most cases far smaller than the time for managing a high number of cells. 

I just checked and found that my solution is slightly faster than IsLightweightModeEnabled alone (mine has set the value to true) but I guess you had to take into account some more issues than I did.

Our business is happy with current performance so case closed :)

best regards, Jan

Tags
GridView
Asked by
Jan
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Jan
Top achievements
Rank 1
Share this question
or