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

React Grid Column Width Support for %

3 Answers 1667 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 05 Sep 2018, 11:15 AM
We are migrating to React Grid from React Wrapper Grid and one issue is that the column width doesn't seem to support % and only seems to support pixel width. Is there a work around for this or is this in any upcoming releases?

3 Answers, 1 is accepted

Sort by
1
Stefan
Telerik team
answered on 06 Sep 2018, 09:04 AM
Hello, Ryan,

This is one of the feature requests that we have.

I can suggest and comment on it as it will increase its chances to be implemented sooner:

http://kendoui-feedback.telerik.com/forums/908425-kendo-ui-for-react-feedback/suggestions/34412002-grid-set-column-width-by-percentages-or-pixels

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
1
Eric
Top achievements
Rank 1
answered on 01 Aug 2019, 03:58 AM
This is a feature that I have wanted as well. I guess the issue is making the feature work when someone has, for instance, 4 columns and they want the first one to be a fixed width, let's say 50 pixels, they then want to enter 25% for the next column and let the final two columns split the difference. I can imagine the code to make that work could be challenging. I'd like to know what this feature would look like if it were to be considered.
0
Nikola
Telerik team
answered on 05 Aug 2019, 08:04 AM
Hi,

As we revived this thread, it worth mentioning we added some documentation about it: 
https://www.telerik.com/kendo-react-ui/components/grid/columns/width/

Further feedback is always appreciated. 

Regards,
Nikola
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Ethan
Top achievements
Rank 1
commented on 09 Mar 2022, 05:31 PM | edited

This doesn't seem to work anymore.  Setting percentage widths using the CSS in the article (.k-grid-header col:nth-of-type(1)) only changes the header of the column, not the rest of it.

The width prop on Columns do not support relative units, either.

Stefan
Telerik team
commented on 10 Mar 2022, 05:42 AM

Hello,

I tested the example and the width is still applied in percentage:

https://www.telerik.com/kendo-react-ui/components/grid/columns/width/#toc-grid-with-no-fixed-width

Both CSS rules are required because one is for the header and one of the table:

    .k-grid-header col:nth-of-type(1){
        width: 20%
    }
    .k-grid-table col:nth-of-type(1){
        width: 20%
    }
Each column required two CSS rules.

Tags
General Discussions
Asked by
Ryan
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Eric
Top achievements
Rank 1
Nikola
Telerik team
Share this question
or