Unplanned
Last Updated: 09 Dec 2020 09:02 by ADMIN
Joel
Created on: 14 Dec 2017 21:55
Category: Grid
Type: Feature Request
0
Allow radgrid bulk update column widths
I have a RadGrid with around 150 columns and a few hundred rows. Currently, I'm looping over them and setting their widths with the resizeColumn function. Unfortunately, it's triggering a recalculation of the layout every time I call this function, so the total page load time can be in the minutes.

Oddly, much of the time was spent on the line:
e.style.width=e.offsetWidth-d+"px";

Chrome's developer tools helpfully pointed me at Forced Reflow. Apparently, when a width is set, initially no extra work is done. When another width is requested, the previous width may have changed it, so the whole layout gets recalculated.

The feature I'd like to request is a function to set column widths in bulk (accepting anything like an array or a dictionary would be fine) that doesn't trigger this recalculation mid-function.
3 comments
ADMIN
Attila Antal
Posted on: 09 Dec 2020 09:02

Hi Joel,

Thank you for your patience! We had the chance to review the source code and we Identified a few areas we could improve. We accept this as a valid Feature Request and place it on the list with the others. 

Due to the nature of the Grid's design, we are uncertain if a new feature will be implemented for this or the current logic will be improved to make it reduce the number of work it does. Once we have more information, we will update this item accordingly.

Regards,
Attila Antal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

ADMIN
Attila Antal
Posted on: 22 Oct 2020 17:38

Hi Joel,

Thank you for the clarification. That did help us have a better understanding.

We will look into this and get back to you once we're done.

Regards,
Attila Antal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Joel
Posted on: 15 Oct 2020 18:48

The status was changed to Need More Info. Was there some particular information needed?

As best I recall, the issue is using e.offsetWidth inside a loop that also changes the width. To get that value, it sees the width has changed recently and recalculates the width of every column to determine the current offsetWidth. If you manually set each column's width, it will recalculate the width of each column every time you read a new width. I'm looking for a way to set column widths and have it recalculate once (calculate 150 columns), not calculate every column for each column (calculate 150 x 150 = 22500 columns).

Please let me know if there is any more I can help with.