I am using DataGrid from MUI and inside GridColDef I dont use anything related to width, I want to have columns to have width of longest data so that every letter is shown, is it possible?
Below is my GridColDef:
{
field: 'lastLogin',
type: 'dateTime',
headerName: 'Last login',
align: 'right',
headerAlign: 'right',
}
I believe you can use minWidth, see here - material-ui / data-grid flexible column width min-width
It has been a while since I have used any of that myself but I do remember having a minWidth with elipsis.
(Pro plan only)
Autosizing Reference: https://mui.com/x/react-data-grid/column-dimensions/#autosizing
<DataGrid
{...otherProps}
autosizeOptions={{
columns: ['name', 'status', 'createdBy'],
includeOutliers: true,
includeHeaders: false,
}}
/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With