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

Simple data binding slow

5 Answers 280 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kristoffer
Top achievements
Rank 1
Kristoffer asked on 25 Apr 2013, 02:44 PM
Running the latest 2013 version.

I read this:
http://www.telerik.com/help/wpf/radgridview-performance-tips-tricks.html

And it makes sense that a large dataset should be time consuming...
"Binding large dataset to the RadGridView is a time consuming task that can at times test the user’s patience."

I'm binding to 10 items and it takes 62 milliseconds (measured from DataLoading to DataLoaded). However, the control takes around a second to display the items. This makes no sense at all. I have bound to a simple data item with simple dependency properties:

<Window x:Class="Vironova.MiniTem.Views.MyTableWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        Title="MyTableWindow" Height="700" Width="300">
        <telerik:RadGridView x:Name="radGridView" Width="Auto" Height="Auto" AutoGenerateColumns="False" ItemsSource="{Binding MyViewModel.MyObjects}" SelectionMode="Multiple" DataLoadMode="Asynchronous">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding MyType}" Header="Type"/>
                <telerik:GridViewDataColumn DataFormatString="F1" DataMemberBinding="{Binding Value}" Header="Value"/>
            </telerik:RadGridView.Columns>   
        </telerik:RadGridView>
</Window>

MyObjects is an ObservableCollection<>.

Also, when scrolling this list of items (setting the height to a lower value) it lags.

What could be causing this?

UPDATE:
I just realized that all filter functions seem to clear the list. If I sort on the first column, the items go away. I then have to click two times until the sort arrow disappears - then the items are re-populated (after a second of wait).

5 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 26 Apr 2013, 08:40 AM
Hi,

You can also go through the Degraded Performance
help article suggesting on how you could improve the performance. 

Let me know if this helped.
 

Kind regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Kristoffer
Top achievements
Rank 1
answered on 29 Apr 2013, 07:47 AM
Hi,

I already read that. We have no obvious bottlenecks. We bind to an ObservableCollection<> with DependencyObject-derived objects (could this have an impact?). If I remove all columns (and the bindings) in the DarkExpression-themed GridView, the performance is still the same. Scrolling is hacky. If I change the objects to some simple doubles, the performance is good!

DP has a lot of properties. Do you enumerate all of them when binding?

UPDATE: I managed to get rid of this performance problem by removing the inheritance to DependencyObject. Can you please explain why this implies such an impact on performance?
0
Dimitrina
Telerik team
answered on 01 May 2013, 12:13 PM
Hello,

Generally we would recommend your business object to implement the INotifyPropertyChanged interface and not DependencyObject. I have tested both the cases at my end, but still I did not noticed such bad scrolling performance when inheriting DependencyObject.

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Peter
Top achievements
Rank 1
answered on 28 Dec 2013, 03:25 PM
Hi,
I bind a datatable with 5 columns and approx 200 rows and I encounter also very slow peformance. It takes a couple of seconds before the grid displays its data (version 2013Q1 to latest). When i try the microsofts wpf gridcontrol the data displays emmidiately. I see a lot of complains in the forum about the speed of the RadGridView and don't understand why you not take these issues seriously.

Many thanks
Peter
0
Dimitrina
Telerik team
answered on 30 Dec 2013, 08:24 AM
Hi,

If you use DataTable, then my suggestion would be to set RadGridView's ItemsSource to be its DefaultView.

In order to increase the performance you can apply the recently introduced Lightweight Templates. You should also make sure you follow the general recommendations we have listed here.

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Kristoffer
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Kristoffer
Top achievements
Rank 1
Peter
Top achievements
Rank 1
Share this question
or