Ticket T701866
Visible to All Users

DataGrid - How to enable the "auto size" capability and set a fixed width for certain columns

created 6 years ago

Hello, I'm using your material-ui Grid.
https://devexpress.github.io/devextreme-reactive/react/grid/docs/guides/getting-started/

I want all the columns in my grid to size automaticly, according to the cell's maximum content width .
If i could, i would wish to ajust this "autosize" to a specific columns, whereas other columns get a fixed with - where autosize property also gives the possibility of a maximum width before it cuts off the content of the column.

Is there any possibility to achieve that?

Here a list of my current devexpress packets:

├─ @devexpress/dx-core@1.9.1
├─ @devexpress/dx-grid-core@1.9.1
├─ @devexpress/dx-react-core@1.9.1
│  ├─ @devexpress/dx-core@^1.9.1
│  └─ prop-types@^15.6.2
├─ @devexpress/dx-react-grid-material-ui@1.9.1
│  ├─ classnames@^2.2.6
│  └─ prop-types@^15.6.2
├─ @devexpress/dx-react-grid@1.9.1
│  ├─ @devexpress/dx-grid-core@^1.9.1
│  └─ prop-types@^15.6.2

Answers approved by DevExpress Support

created 6 years ago (modified 6 years ago)

Hello Frank,

By default, DataGrid columns have the width of a cell's maximum content width. If you wish to change it, you can set the width option and/or minWidth one depending on your requirements.

    Comments (1)
    FK FK
    Frank Krätzig 6 years ago

      Thanks!

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.