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

Scrolling performance when binding RadGridView to DataTable's DefaultView

5 Answers 233 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 21 Nov 2013, 04:24 PM
Hello,

I am using the Q3 2013 Telerik release (2013.3.1016). I am doing a simple binding to the DefaultView of a DataTable. Due to the nature of the requirement, I need to have AutoGenerateColumns set to true, but I'm really not doing anything special otherwise.

What I'm noticing is that when bound to the DefaultView of a DataTable with just 200 rows and 4 columns, the scrolling performance is so bad as to be unusable. It's extremely jerky and very slow, again to the point of being completely unusable. When I bind directly to the same DataTable (without using the DefaultView), there is absolutely no problem with scrolling - it is smooth and seamless.

I've tried everything that I can think of to improve performance, including everything on your RadGridView "Performance Tips and Tricks" at:
http://www.telerik.com/help/wpf/radgridview-performance-tips-tricks.html. The reason that I need to use the DefaultView is for the data binding and error features implemented on the DataView but not the DataTable. I've tried all sorts of hacks with changing data in the DataTable from my ViewModel, firing an event that my codebehind subscribes to, and constantly calling Rebind() on the RadGridView, but I'm still left with issues that require no effort when simply bound to the DefaultView. There just has to be a way to achieve smooth scrolling with a meager 200 rows and 4 columns.

1: The RadGridView is in a Grid with the row height set to star and the column width set to star. There is no "infinity" based measurement going on.

2: I have EnableRowVirtualization set to "True", and I've confirmed that this is working using WPF Inspector (similar to Snoop). Furthermore, I've turned virtualization off, and although scrolling performance becomes perfectly smooth even with the DefaultView, memory usage becomes absurdly high. I will need to keep virtualization on.

3: Originally I had the property bound as part of the DataTable, like this: ItemsSource="{Binding MyDataTable.DefaultView}". After reading your tips and tricks regarding not using property paths to improve performance, I exposed the DefaultView directly on my ViewModel so that the binding became ItemsSource="{Binding MyDefaultView}". This did not improve performance at all.

4: I'm not using any custom styles or templates at all.

5: My WPF application is globally using the Windows8 Theme (StyleManager.ApplicationTheme = new Windows8Theme() is right before InitalizeComponent() on my MainWindow.xaml.cs, also per your documentation). According to your "Tips and Tricks", this uses "lightweight templates" that should improve performance, but again, testing with different themes produces the same terrible scrolling performance.

6: I've tried using ScrollMode="Deferred", but the behavior is not desirable, and even when letting go of the mouse to let the GridView render, there is a very long pause while the data renders.

7: Paging is not a viable solution here and can't be used for several reasons, the most important of which is that the users want to view this GridView like they would in Excel.

With all that in mind, here is the XAML for my RadGridView (note that ImportDataView is the DefaultView of my DataTable, exposed directly from the ViewModel):

<telerik:RadGridView
  Name="PreviewDataGridView"
  ItemsSource="{Binding ImportDataView}"
  EnableRowVirtualization="True"
  SelectionMode="Extended"
  SelectionUnit="Mixed"
  IsReadOnly="False"
  AutoGenerateColumns="True"
  ShowGroupPanel="False"
  ShowInsertRow="False"
  ReorderColumnsMode="None"
  CanUserInsertRows="False"
  CanUserDeleteRows="True"
  CanUserResizeRows="False"
  CanUserSelect="True"
  CanUserSortColumns="False"
  CanUserFreezeColumns="False"
  CanUserReorderColumns="False"
  IsFilteringAllowed="False"
  BorderBrush="Black"
  BorderThickness="1"
  Margin="4, 6, 4, 4"
  Grid.Row="2"
  Grid.Column="0">
 </telerik:RadGridView>

I've spent a ton of time trying to figure this out and could really use some help.

Thanks for your time,
Jon

5 Answers, 1 is accepted

Sort by
0
Jon
Top achievements
Rank 1
answered on 22 Nov 2013, 04:39 PM
Hello,

I just want to note that I built a sample application in the hopes of demonstrating this issue, and of course the issue doesn't appear at all. Although I took great care for my sample application to be identical to my "real" implementation, there is obviously some sort of difference that I'm not seeing.

I would still appreciate any ideas, but you can consider this issue closed.

Thanks,
Jon
0
Yordanka
Telerik team
answered on 25 Nov 2013, 02:41 PM
Hello Jon,

Do you have any BindingErrors in the Output window while scrolling? Also, could you try with the Microsoft DataGrid? Do you get the same result?

Regards,
Yordanka
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 >>
0
Jon
Top achievements
Rank 1
answered on 25 Nov 2013, 03:37 PM
Yordanka,

Thanks for your reply. I do not have any binding (or other) errors in the output window while scrolling (or not scrolling). Per your request, I just tried using the WPF Extended Toolkit "DataGridControl", and it scrolls extremely smoothly with the DefaultView, no matter how many records I throw at it.

I am very confused at this point. Like I mentioned above, I created a sample application with the Telerik RadGridView that had no problems scrolling smoothly while using the DefaultView. Again, I took great care ensuring that the sample application was as close as possible to the "real thing".

Even since originally writing my post, I have tried to eliminate other possible differences. The last difference I have yet to test is the fact that our production application uses the "MahApps.Metro" third party assembly.

Do you have any known issues with the "MahApps.Metro" package? Any answer to that or any other ideas would be greatly appreciated.

At this point I have the functionality 100% where I need it, except for the fact that it's completely unusable due to performance. I can't understand why considering it performs fine in my sample app.

I will continue to look into it.

Thanks for your help,
Jon
0
Yordanka
Telerik team
answered on 27 Nov 2013, 10:12 AM
Hello Jon,

We didn't tested Telerik controls with "MahApps.Metro" package and we don't have information for any issues or problems. 
Unfortunately, without a project which reproduces the problem we will not be able to assist in resolving it. I can suggest to check our WPF demo - GridView --> Various Data Sources when there is such with DataTable source.

Regards,
Yordanka
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 >>
0
Jon
Top achievements
Rank 1
answered on 27 Nov 2013, 02:50 PM
Yordanka,

I completely understand. I have temporarily shelved this issue until I complete the requirement, then I'm going to circle back around to it. If I find a solution, I will post it in hopes that it may help someone else who runs into a similar issue.

Thanks,
Jon
Tags
GridView
Asked by
Jon
Top achievements
Rank 1
Answers by
Jon
Top achievements
Rank 1
Yordanka
Telerik team
Share this question
or