Grid columns width

1 Answer 57 Views
Grid
Fred
Top achievements
Rank 1
Fred asked on 14 Apr 2023, 11:01 AM
How can I create a KendoReact grid with columns that automatically adjusts to the width of the longest content in each column ?

1 Answer, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 18 Apr 2023, 06:37 AM

Hi Fred,

You can use the fitColumns method of the Grid's API to adjust the width based on the content of the columns. Here is an example with such approach:

As you will notice, the fitColumns accepts an array with the id's of the columns you want to adjust and in the first link with the example I have shown how to obtain the generated id's for the columns. 

Hope this helps.

 

Regards,
Konstantin Dikov
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.

Tags
Grid
Asked by
Fred
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or