Moving RadGridView to new window is very slow

1 Answer 37 Views
GridView
alex
Top achievements
Rank 2
Iron
Iron
Iron
alex asked on 15 Nov 2022, 06:57 PM | edited on 15 Nov 2022, 06:58 PM

Hello,

I have a RadGridView with 5,000 rows and 20 columns with virtualization enabled. I have the grid on the left side of the main window (fixed position).

I added a button.

When the user clicks the button, it will open a new window and the grid should move to the new window.

Somemehow the performance is too slow. 

As mentioned I an using virtualization, regular window, no styles and it tooks like 2-3 seconds to open the window.  The cells'  values may change but not too much. I tried to call the Show() method first and give to the window fixed width and height, also for the RadGridView but when I do the following:

window.Content = radGridView

It takes a while to skip that line. 

Do you have any advice? and/or a sample application with a similar behavior that doesn't have this performance issue? I can use it to compare with my code.

 

Dilyan Traykov
Telerik team
commented on 18 Nov 2022, 10:45 AM

Hello alex,

Based on your description, I prepared a small sample project in an attempt to replicate the performance issue you described, however, the new window with the RadGridView as its content is shown almost immediately at my end.

Can you please have a look at the attached project and let me know if you observe the issue with it?

Generally speaking, even though the EnableRowVirtualization and EnableColumnVirtualization are set to True by default, the UI virtualization can still be disabled in cases where the RadGridView control is placed in a panel that measures it with infinity, for example. To troubleshoot this, please try applying the modifications mentioned in the Tips and Tricks article and let me know if you still observe the degraded performance.

alex
Top achievements
Rank 2
Iron
Iron
Iron
commented on 23 Nov 2022, 06:34 AM

Hello, thanks for your reply.

The panel is not measured to infinity.

I will check your example and let you know.

1 Answer, 1 is accepted

Sort by
0
alex
Top achievements
Rank 2
Iron
Iron
Iron
answered on 23 Nov 2022, 07:10 AM | edited on 23 Nov 2022, 07:12 AM

Hello,

I compared your code to my test code. The only difference is the column count, and AutoGenerate=True.

When I create 4 columns, my code work fast as yours.

Please try to do the same with 30 columns with virtualization.

On this scenario it takes a lot to draw the RadGridView.
Maybe although using virtualization, do you have a lot of code inside on the Main Thread?

alex
Top achievements
Rank 2
Iron
Iron
Iron
commented on 23 Nov 2022, 06:12 PM

Please also see in the question that the problem appeared with 20 columns. Your solution is with 4 columns. Thanks.
Dilyan Traykov
Telerik team
commented on 25 Nov 2022, 10:39 AM

Hello alex,

Please let me start by clarifying that even though the 4 unique columns (Name, Number, Position, Country) are copied several times, they are still treated as 20 separate columns.

Nonetheless, I've updated the sample project to include 30 unique columns (generated dynamically) and set the AutoGenerateColumns property to True, however, I still do not observe any noticeable delay at my end.

Can you please have a look at the updated project and let me know if I'm missing something of importance? If that is the case, please modify the project to demonstrate the issue and send it back to me so that I can further investigate.

On a side note, you can try the approaches suggested in the Tips and Tricks article to check whether any of them improves the performance of your original application.

alex
Top achievements
Rank 2
Iron
Iron
Iron
commented on 29 Nov 2022, 08:21 AM | edited

Hi, I know that drawing same columns should not affect. I taught you created only 4 columns.

I think that the difference may be the property GroupdRenderMode.

When I set to Flat, then my rows height are too big (only one row is seen in full screen).

When I put my ViewModel in your code, the same occurs.

The view models just hold 30 properties and it is not a DataTable.

Can you guide me what am I doing wrong?

Dilyan Traykov
Telerik team
commented on 30 Nov 2022, 12:14 PM

Hi Alex,

Generally speaking, we recommend using the Flat GroupRenderMode as it results in better performance and most of the latest features and bug fixes only target this mode.

With this said, can you please modify the sample project to demonstrate how changing the GroupRenderMode also changes the row height as normally this should not be the case?

alex
Top achievements
Rank 2
Iron
Iron
Iron
commented on 30 Nov 2022, 05:26 PM

I took your project and changed the DataContext to a ViewModel with 30 string properties instead the DataTable. In this case, the row height change. 

I think that it will reproduced easier in your end without the data table. It is a surprise that you recommend Flat mode and this is not the default on your style.

Dilyan Traykov
Telerik team
commented on 01 Dec 2022, 01:01 PM

Hi Alex,

Based on your feedback, I replaced the DataTable with an ObservableCollection of objects which contain 30 CLR properties. I do not, however, notice any change in the row height when using the Flat GroupRenderMode as opposed to the Nested. I also do not see any performance degradation, similarly to when using the DataTable.

Please have a look at the updated project and let me know if I'm missing something of importance. To speed up the process, if any modifications are required to reproduce the issue, please feel free to make them directly in the project and send it back to me for further investigation.

Regarding your concern regarding the GroupRenderMode property, we did consider setting this to Flat by default but decided to leave the legacy Nested value to avoid introducing a breaking change for our customers. I do hope this makes sense.

Tags
GridView
Asked by
alex
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
alex
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or