How do I enable column resize for user on MUI DataGrid, it is enable by default on XGrid, but I want to enable it on Datagrid, please help.
<DataGrid
className={classes.table}
autoHeight
disableColumnMenu
rows={rows}
columns={columns}
pageSize={50}
onPageChange={handlePageChange}
rowCount={rowCount}
paginationMode="server"
loading={loading}
rowsPerPageOptions={[]}
/>
How do I enable column resize for user on MUI DataGrid, it is enable by default on XGrid, but I want to enable it on Datagrid, please help.
<DataGrid
className={classes.table}
autoHeight
disableColumnMenu
rows={rows}
columns={columns}
pageSize={50}
onPageChange={handlePageChange}
rowCount={rowCount}
paginationMode="server"
loading={loading}
rowsPerPageOptions={[]}
/>
Share
Improve this question
edited Jun 11, 2023 at 3:43
Mausom Saikia
asked Jul 24, 2021 at 11:54
Mausom SaikiaMausom Saikia
1701 gold badge1 silver badge10 bronze badges
2
|
2 Answers
Reset to default 12If you are using MUI V6, resizable columns are available only in the comercial version (XGrid).
In the new V7 it is available to the free MIT version https://mui.com/x/react-data-grid/#mit-version-free-forever
Since MUI X v7.0.0 column resizing and auto-sizing are now available on the community plan. source
resizable
onGridColDef
interface. You provide list of column definitions to thecolumns
prop onDataGrid
. Maybe the solution is to set it on column level. – Sebastian.Belczyk Commented Jul 24, 2021 at 12:53