Kendo Grid Locked Columns Fixed Width

0 Answers 32 Views
Grid
Lee
Top achievements
Rank 1
Iron
Iron
Iron
Lee asked on 16 Aug 2022, 02:50 PM | edited on 16 Aug 2022, 04:22 PM

I have a kendo grid and I need to set one of the columns to a fixed width that is always exactly 120px. My issue is that if the screen is wider than the total set width of all of the columns it starts expanding the columns. This is good for everything except my one column that needs to always be the same. I also tried leaving the width off of one of the columns. The problem with that is that when the screen is narrow (like a phone or tablet) the column without a set width disappears. Another trick I tried is using the template to wrap the column in a span tag with a fixed width, however that just overflows the cell. How do I solve for this?

Dojo: https://dojo.telerik.com/iDUtIvow

Nikolay
Telerik team
commented on 19 Aug 2022, 09:12 AM

Hi Lee,

The requirements for the Grid to work with frozen column(s) include:

 - Set explicit pixel widths to all columns to allow the Grid to adjust the layout of the frozen and non-frozen table parts.

 - Make sure that the total width of all locked columns is equal to or less than the width of the Grid minus three times the width of the scrollbar.

If one or more columns are left without width the Frozen functionality will not work and the scrollbar for the non-frozen columns will not appear.

I think what is best is to set the desired 120px width for that one column and set a big enough width for all other columns so they do not expand on a bigger screen.

Hope this helps.

Regards,

Nikolay

Lee
Top achievements
Rank 1
Iron
Iron
Iron
commented on 19 Aug 2022, 12:17 PM

Unfortunately it does not help. Doing that would create a column that is too wide on smaller screens requiring a lot of unnecessary horizontal and back and forth horizontal scrolling. 
Nikolay
Telerik team
commented on 24 Aug 2022, 09:17 AM

Hi Lee,

I am afraid this is a limitation of the frozen columns and there is not much we can do to achieve the desired.

You can get rid of the frozen columns if that is an option and then you will be able to have a fixed width for just one column and adjustable width for the rest.

Regards,

Nikolay

Lee
Top achievements
Rank 1
Iron
Iron
Iron
commented on 24 Aug 2022, 12:22 PM | edited

Unfortunately that is not an option either. The requirement is locked first columns and fixed width on the button column.
Nikolay
Telerik team
commented on 29 Aug 2022, 08:15 AM

Hi Lee,

Unfortunately, this lands into the limitations of the frozen columns functionality of the Grid and there is no workaround for it.

Regards,

Nikolay

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Lee
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or