how can i change Grid width relative to viewport without fixed width or without width property?

1 Answer 39 Views
Grid
Nurik
Top achievements
Rank 2
Iron
Iron
Nurik asked on 16 Dec 2024, 06:38 AM
how to create a responsive KendoReact Grid that adjusts its width dynamically based on the viewport without relying on fixed widths or the explicit width property

1 Answer, 1 is accepted

Sort by
1
Accepted
Vessy
Telerik team
answered on 16 Dec 2024, 05:55 PM

Hello,

The KendoReact Grid is designed to be responsive by default and you can leverage its responsive capabilities out of the box. It behaves like a block-level element and automatically expands to fill the available 100% width of its parent container. This means you don't need to set any explicit width for the Grid itself neither to its columns to make the grid resizable based on the viewport space:

You can test this behavior in the sample below:

I hope this helps but let me know if I can assist you any further on this matter.

    Regards,
    Vessy
    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.

    Nurik
    Top achievements
    Rank 2
    Iron
    Iron
    commented on 17 Dec 2024, 04:29 AM | edited

    That means that I can't change width of grid columns relatively of my viewport width? For my task I need to change width of column dynamicly with viewport width, 'cause width: 100% and fixed width is not proper for my problem.
    Vessy
    Telerik team
    commented on 18 Dec 2024, 04:28 PM

    Hi, Nurik,

    You can use percentage values fro the widths of the columns in the Grid by implementing the approach given in the following article - https://www.telerik.com/kendo-react-ui/components/grid/columns/width#setting-column-widths-in-percentage 

    Tags
    Grid
    Asked by
    Nurik
    Top achievements
    Rank 2
    Iron
    Iron
    Answers by
    Vessy
    Telerik team
    Share this question
    or