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

Grouping and UI Virtualization

8 Answers 89 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 08 Dec 2014, 04:19 AM
Hi,

We are using WPF RadGridView in our screen.
We notice that the screens which have RadGridView without grouping perform better but the screens where grouping is enabled take a long time to load.
Our best guess is that UI virtualization is not happening for RadGridView with grouping enabled.

Is UI Virtualization turned off when grouping is enabled? If yes, please suggest an alternative way to improve performance.

Thanks.

8 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 08 Dec 2014, 12:19 PM
Hello,

May I ask you to try setting the GroupRenderMode property of RadGridView to "Flat". The Flat mode represents a completely new logic for group rendering, which fixed a lot of other issues reproducible with the old Nested mode. 

Would you please give the suggested approach a try and let me know how it goes.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Tim
Top achievements
Rank 1
answered on 09 Dec 2014, 05:10 AM
Hi Dimitrina,

We have set GroupRenderMode to Flat already.
0
Dimitrina
Telerik team
answered on 09 Dec 2014, 09:57 AM
Hello,

Generally, the UI Virtualization is still active when there is grouping applied.

Ðœay I ask you to try isolating the issue in a demo project illustrating your implementation? You can also take a look at this blog post for a reference on how to isolate an issue. That way we can check it locally and advise further.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Tim
Top achievements
Rank 1
answered on 09 Dec 2014, 02:03 PM
Hi Dimitrina,
We are able to isolate the issue. I have uploaded the sample here:  http://1drv.ms/1znQkRX

Please follow the following steps to reproduce the issue:
1) Open ZM.SFA.Tab.All.sln under the All folder. ZM.SFA.Tab.Core project should be the startup project.
2) "C:\Logs\WriteLines.txt" is a file I write to check if virtualization is happening or not. Please create a folder called "Logs" in your C: drive and create a text file with the name "WriteLines.txt".
3) Rebuild the solution in Debug mode.
4) Run the application.
5) Keep the C:\Logs\WriteLines.txt open in Notepad++. Make sure it is empty.
6) Click on the button "NO GROUPING". The C:\Logs\WriteLines.txt will have 15 entries. Even though there are 127 records in the grid, the getter in model is hit only 15 times.
7) Click on the Close (X) button on the tab called "CustSearchHeader".
8) Now clean the C:\Logs\WriteLines.txt file.
9) Now click on the button "GROUPING".
10) You will notice that C:\Logs\WriteLines.txt file has 503 entries. This means Virtualization is not happening.​

Please help.
Thanks.
0
Dimitrina
Telerik team
answered on 10 Dec 2014, 04:58 PM
Hello,

Thank you for sending your solution along with the steps on how to reproduce the issue. I was able to reproduce the described behavior. I am going to investigate the case further and contact you back.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Dimitrina
Telerik team
answered on 11 Dec 2014, 01:56 PM
Hello,

I tested the demo project and as it turns out the UI virtualization is working properly and GridViewRow objects are only created for the rows requested to be displayed into view.
For the purpose, I subscribed for the RowLoaded event of the custom ZeeGrid and I write in the file every time a row is loaded:
private void SearchResultsGrid_RowLoaded_1(object sender, RowLoadedEventArgs e)
{
    if (e.Row is GridViewRow)
        System.IO.File.AppendAllText(@"C:\Logs\WriteLines.txt",
            "Get" + Environment.NewLine);
}

Finally, for a grouped RadGridView I got just 24 records Get in the WriteLines.txt file.

Would you please check this at your side?

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Dipti
Top achievements
Rank 1
answered on 15 Dec 2014, 07:29 AM
Hi Dimitrina, thanks for the reply.

You are right, same number of records is logged when we place the log in
ZeeGrid xaml.cs. But there is a huge performance difference in the time taken
to load the screen with and without grouping.

I edited the same sample and increased the number of records and added log in
the UserControl's Loaded event. Please follow the steps below to reproduce the
performance difference:

1) Add this in the Loaded event of the SearchCustomer's Loaded event:
    var logger = LogManager.GetLogger("ZM.SFA.Tab");
    logger.Info("SearchCustomer Loaded");
Add this in the SearchCustomerGrouping's Loaded event:
    var logger = LogManager.GetLogger("ZM.SFA.Tab");
    logger.Info("SearchCustomerGrouping Loaded");
2) Rebuild the solution in Debug mode and run.
3) Click on the button "No Grouping".
4) Open the log file present in: C:\Logs\Logfile.txt. Notice the time difference between the log entries:
2014-12-15 12:33:43.8167|Info|ZM.SFA.Tab|Entering SearchCustomer
2014-12-15 12:33:45.4398|Info|ZM.SFA.Tab|SearchCustomer Loaded
5) The time taken to load 10001 records without grouping is 45.4398- 43.8167= 1.6231 seconds.
6) Now close the application. Run the application again (to avoid caching).
7) Click on the button "Grouping".
8) Now note down the time taken to load the records:
2014-12-15 12:35:09.4254|Info|ZM.SFA.Tab|Entering SearchCustomer
2014-12-15 12:35:11.5437|Info|ZM.SFA.Tab|SearchCustomerGrouping Loaded
9) The time taken to load 10001 records with grouping is 11.5437- 09.4254= 2.1183 seconds.

There is a performance difference, 1.6 sec without grouping and 2.1 sec with grouping. 

If UI Virtualization is happening even with grouping, then there is something else which causes this performance degradation when grouping is enabled.
Can you please suggest how we can address this performance degradation?

Thanks.
Dipti 
0
Dimitrina
Telerik team
answered on 16 Dec 2014, 10:00 AM
Hello Dipti,

As you have already set GroupRenderMode to Flat, then I am afraid there is not much specifically related to grouping I can suggest. I would recommend you going through our online documentation on possible reasons why there would be degraded performance with it. You can consider the tips listed there .

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Tim
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Tim
Top achievements
Rank 1
Dipti
Top achievements
Rank 1
Share this question
or