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

Telerik GridView inside RadLayoutControl performs terribly

5 Answers 234 Views
LayoutControl
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 08 Nov 2019, 10:16 AM

Hello,

I have a View which I want to split into 4 sub-parts, flexibly. To do this I tried to take advantage of the RadLayoutControl. In one of the 4 sub-, I place a RadGridView which binds to a collection giving it exactly 1000 rows. The performance with this configuration is terrible, and not usable.

If I comment out the usage of the RadLayoutControl and it's sub-elements, and just show the same GridView, the performance is fine.

I am aware of the performance restrictions on the RadGridView, please see:

https://docs.telerik.com/devtools/wpf/controls/radgridview/troubleshooting/performance
https://docs.telerik.com/devtools/wpf/controls/radgridview/performance/tips-tricks
which are somewhat redundant as they show the same information.

Most likely the "problem" is:
RadGridView is placed in a control that measures its children with infinity - such controls are:
ScrollViewer
StackPanel (when vertical it measures with infinite height and when horizontal - with infinite width)
Grid with RowDefinition Height="Auto" or ColumnDefinition Width="Auto".

I do not place the GridView in any Grid where Height="Auto" or ColumnDefinition Width="Auto".
However, looking at the visual trees in snoop, it is clear that "LayoutControlGroup", "LayoutControlExpanderGroup" etc. all add their own Grids and ScrollViewers.

How can I then put a GridView inside of a nested set of Layout Controls and get it to work normally?

For your information, my nested Layout Controls are very similar to those in the Demo Code Samples for "Layout Control", "First Look". Nothing special.

Thanks,
Mark

5 Answers, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 08 Nov 2019, 10:42 AM
I neglected to mention that my 4 sub-regions are split using the LayoutControlSplitter, two vertical and one horizontal.
0
Dilyan Traykov
Telerik team
answered on 12 Nov 2019, 01:43 PM

Hello Mark,

For the RadGridView controls to perform as expected when placed inside a RadLayoutControl, you need to specify a MaxHeight for it so that its virtualization mechanism can kick in. For the purpose, you can set a fixed height or calculate the value based on the other elements in your view.

Please give this a try and let me know if you find it possible.

Regards,
Dilyan Traykov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Mark
Top achievements
Rank 1
answered on 15 Nov 2019, 10:06 AM

Hello Traykov,

Well, that fixed the problem.

"calculate the value based on the other elements in your view" would involve a lot of code-behind I imagine, or are there any Telerik Framework helpers for this?

Thanks,
Mark

0
Dilyan Traykov
Telerik team
answered on 15 Nov 2019, 03:13 PM

Hello Mark,

I'm happy to hear that this resolved your issue. To address your other inquiry, I'm afraid there are no such helpers available out of the box.

If I can, however, assist you with anything else, please let me know.

Regards,
Dilyan Traykov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Mark
Top achievements
Rank 1
answered on 15 Nov 2019, 03:33 PM
Thank you Dilyan!
Tags
LayoutControl
Asked by
Mark
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Dilyan Traykov
Telerik team
Share this question
or