Skip to content

How To Fit Grid Vertically to Container? #3383

Closed Answered by AYColumbia
AYColumbia asked this question in Q&A
Discussion options

You must be logged in to vote

I wanted to post my solution as I finally found how to accomplish what I needed. I finally found the demo code which led to the solution since the demo site was doing what I wanted.

I updated my grid container class as below. The min-height I used because if there's no data, the grid does not size so there has to be at least one row. Then I use the fit-grid class directly on data grid, i.e., <DataGrid className="fit-grid".../>.

CSS classes:

.grid-container
    {
        height: 100%;
        overflow: auto;
        min-height: 350px;
    }

    .fit-grid
    {
        block-size: 100%;
    }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AYColumbia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant