We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

DataGrid performance issues

Hello,

i have very important task for you. In my company project i using syncfusion components, and large datagrid tables. In attachment is test project with four identical grids. And here i have two problems with performance (after load data into grids).

1. With horizontally scrolling is grid moving very slow. Problem is this code

<syncfusion:GridTextColumn MappingName="XX" HeaderText="" Width="5" CellStyle="{StaticResource DataGridGapCell}" HeaderStyle="{StaticResource DataGridGapHeader}" AllowEditing="False" />

This code is for separating stacked coilumns, and for visual style. But is very simple, where is problem?

2. If i switch into another tab, first load (drawing grid into presentation layer/page) is slow (ap. 3s). Imagine, if i have in my project twenty tabs. 

Tested on Windows 8.1 x64

Thank you for helping me to improve DataGrid in Syncfusion.

Martin

Attachment: TestWPF_2bfc6eeb.zip

16 Replies

MT Martin Tichovsky January 11, 2017 12:30 PM UTC

I forgot, in the test, speed move of horizontal scrollbar must be medium or faster, then move of datagrid is 'throw'.


JG Jai Ganesh S Syncfusion Team January 12, 2017 11:43 AM UTC

Hi Martin, 
  
We have analyzed your provided sample. Setting style for GridColumn leads to performance delay in horizontal delay where when scrolling horizontally, cell’s style get changed based on Column.CellStyle which leads to performance delay. 
  
In our upcoming release we are adding new rendering approach which can be enabled by setting simple property. We have tested your sample with our new rendering mode (light weight) which solves the performance problem. This implementation will be available in our upcoming Volume 1 main release which is available on February 2nd week, 2017. Please find the below video where we showed horizontal scrolling performance with our new light weight rendering approach, 
 
  
For now, we have modified the GridCell template with minimal items based on the features  you are using. Please find the modified sample, 
 
 
Regards, 
Jai Ganesh S 



MT Martin Tichovsky January 12, 2017 12:41 PM UTC

Thank You for answer. I update the test project, which you find in the attachment. I remove styles in all colums, but scrolling delay still remain. In tab with name 'Table2' i remove this code

<syncfusion:GridTextColumn MappingName="XX" HeaderText="" Width="5"  AllowEditing="False" />

and scrolling is more stabile. I don't now, but its look like problem with rendering emty columns (or columns with same MappingName??)

Thats what i observe with examining this problem. I hope this description help you to found best solution. Thank you

Attachment: TestWPF_new_1f0e3b47.zip


SR Sivakumar R Syncfusion Team January 13, 2017 12:27 PM UTC

Hi Martin, 
 
Thanks for your update. Your observation is correct. No, you should not load column with MappingName which is not in underlying data object. You can see the below binding error in output window visual studio. This causes loading and scrolling performance lacks. 
 
System.Windows.Data Error: 40 : BindingExpression path error: 'XX' property not found on 'object' ''DataStruct' (HashCode=29492576)'. BindingExpression:Path=XX; DataItem='DataStruct' (HashCode=29492576); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String') 
 
You can use GridUnboundColumn for loading empty columns. Also, set different MappingName name for unbound columns also. 
<syncfusion:GridUnBoundColumn MappingName="XX" HeaderText="" Width="5"  AllowEditing="False" /> 
 
 
Please find the modified sample below, 
 
Thanks, 
Sivakumar 



MT Martin Tichovsky January 19, 2017 10:45 AM UTC

Hello, and what about a delay with tab switching? Is there any way to speed up grid drawing into screen, when i tap on other tab?


JG Jai Ganesh S Syncfusion Team January 20, 2017 01:40 PM UTC

Hi Martin, 
The delay with tab switching also improved by using the light weight mode in SfDataGrid. As we already said previously this implementation will be available in our upcoming Volume 1 main release which is available on February 2nd week, 2017
 
Regards, 
Jai Ganesh S 



MT Martin Tichovsky March 3, 2017 12:06 PM UTC

Hello,

i would like to ask, has been new feature to improve rendering of SfDataGrid added in last release. I can't find any log in release notes. Thank you for help


JG Jai Ganesh S Syncfusion Team March 6, 2017 11:08 AM UTC

Hi Martin, 
We have improved the rendering performance of SfDataGrid by using the light weight template and you can enable this by setting the UseDrawing=”{Default}”  in SfDataGrid.  
<syncfusion:SfDataGrid x:Name="grid2" UseDrawing="{Default}"  AllowGrouping="True" BorderThickness="0" AllowRowHoverHighlighting="True" AddNewRowPosition="None" AllowResizingColumns="True" 
                        AllowFiltering="False" AllowDeleting="False" AllowEditing="True" ShowRowHeader="False" AutoGenerateColumns="False" ScrollViewer.HorizontalScrollBarVisibility="Auto"  ColumnSizer="Auto" 
                        SelectionUnit="Cell" Margin="2,40,0,0" AllowSorting="False" AlternatingRowStyle="{StaticResource AlternatingRowStyle}" 
                        FrozenColumnCount="1" TableSummaryCellStyle="{StaticResource TableSummaryStyle}" RowHoverHighlightingBrush="#FFE2FFFF" FontSize="11" FontWeight="Bold" LiveDataUpdateMode="AllowDataShaping"/> 
 
This feature was included in our Volume 1 main release 2017 and this can be download from the below location, 
Regards, 
Jai Ganesh S 



FA Fabio March 11, 2017 07:52 PM UTC

Hi,
I get an error if I use UseDrawing="{Default}", while it all ok if I use UseDrawing="Default" without braces.

Regards


JG Jai Ganesh S Syncfusion Team March 13, 2017 05:44 AM UTC

Hi Martin,  
Sorry for the inconvenience. You can use UseDrawing="Default" instead of UseDrawing=”{Default}” in your sample and please let us know if you need further assistance on this. 
Regards, 
Jai Ganesh S 



FA Fabio March 13, 2017 05:36 PM UTC

Thanks.

Regards


JG Jai Ganesh S Syncfusion Team March 14, 2017 03:42 AM UTC

Hi Martin,  
Thank you for the update. 
Please let us know if you need further assistance on this. 
Regards, 
Jai Ganesh S 



MT Martin Tichovsky January 7, 2018 03:24 PM UTC

Hello, i have research and open performance issue again, and with searching better binding into datagrid i would like to ask, if is possible speed up switching between tabs in attachement test project. With large data in tables take switch to another tab about 3 seconds, which is exhausting for large number of tabs.

Thanks for answer

Attachment: Sample_be846c67.zip


JG Jai Ganesh S Syncfusion Team January 9, 2018 12:24 PM UTC

We are able to reproduce the reported time delay while switch over the tab items in your sample due to you have defined the SfDataGrid inside the ScrollViewer. SfDataGrid has its own ScrollViewer. So, it is not recommended to load the SfDataGrid inside the ScrollViewer as it provides infinite size to its children which leads to lose of UI virtualization. However, you can improve the performance by removing the ScrollViewer and setting the ColumnSizer = “None” and UseDrawing=”Default”, 
<Syncfusion:SfDataGrid Name="sfdatagrid_B" 
                                       AllowEditing="True" 
                                       AllowGrouping="True" 
                                       AutoGenerateColumns="False" 
                                       ColumnSizer="None" 
                                       UseDrawing="Default" 
                                       ItemsSource="{Binding StudentDetails_B}"     
                                       /> 
 
In the above sample we have modified inside the Tab Item B. Likewise you can modify the all tab items. 
Regards, 
Jai Ganesh S


MT Martin Tichovsky January 10, 2018 05:03 AM UTC

Thank you, it's much better! And what if i would like have two datagrid above each other, how can i design scrollview if is there even labels or other content with them in one tab? Thans


JG Jai Ganesh S Syncfusion Team January 12, 2018 02:10 AM UTC

 
As we said in our last update, the performance will be improved by removing the ScrollViewer and also setting the ColumnSizer = “None” and UseDrawing=”Default”. Now, could you please share the more details about your requirement for whether you want still load the DataGrid inside the ScrollViewer ? 
 
Regards, 
Jai Ganesh S

Loader.
Up arrow icon