When a grid column is resized can I prevent other columns from resizing?

1 Answer 195 Views
Grid
Marvin
Top achievements
Rank 1
Iron
Iron
Marvin asked on 01 Sep 2022, 11:42 PM
Instead, can white space just be added to the end?

1 Answer, 1 is accepted

Sort by
0
Hetali
Telerik team
answered on 06 Sep 2022, 04:51 PM | edited on 08 Sep 2022, 08:26 PM

Hi Marvin,

By default, when a column of the Kendo UI Grid is resized, other columns do not resize and white space is added to the end. Please take a look at this example from the Column Resizing article performing the mentioned feature. 

To prevent other columns from resizing when you toggle the visibility of a column from the Kendo UI Grid, set the first column as locked as seen in this updated example.

More information on column widths can be found here.

Let me know if this helps.

Regards,
Hetali
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Marvin
Top achievements
Rank 1
Iron
Iron
commented on 06 Sep 2022, 05:54 PM

Hi Hetali,

Thanks for your response and the example you linked to.  I see now that the behavior I was describing was when hiding and unhiding columns was involved.

In this example, you can see that when a column is hidden with the "toggle" buttons, the other columns resize to use up the space previously used by the hidden column.

You can also see that attempting to to set the other column back to their specified widths after hiding does not work.  (I presume this is due to Angular's change detection mechanism not picking up on the change.

Any help is appreciated.

Marvin

 

 

Hetali
Telerik team
commented on 08 Sep 2022, 08:28 PM

Hi Marvin,

Thank you for the additional information.

To get the desired column width behavior, set the first column as locked. Please take a look at the answer above that I have updated.

Regards,
Hetali
Progress Telerik

Tags
Grid
Asked by
Marvin
Top achievements
Rank 1
Iron
Iron
Answers by
Hetali
Telerik team
Share this question
or