Hi Varisa,
If the Data Grid 2 suddenly renders correctly in Design Mode but all columns are stacked vertically at runtime, while creating a new Data Grid 2 and clearing CSS did not help, I would focus on the compiled theme/CSS being loaded at runtime rather than the Data Grid configuration itself.
A couple of things I would check:
theme/settings.json
"cssFiles": [
"styles/web/css/main.css",
"theme.compiled.css"
]
Mendix specifically mentions this in the Data Grid 2 troubleshooting section for Atlas v2.x.
.widget-datagrid-grid .widget-datagrid-grid-head .widget-datagrid-grid-body
Compare their computed display, grid-template-columns, and related CSS between the working and broken projects.
Since Data Grid 2 uses a grid-based layout for its rows and columns, if those runtime styles are missing or overridden, the cells can end up appearing vertically instead of as a table.
Given that you've already tried a fresh Data Grid 2, new test page, clean CSS, and DevTools, I'd compare the working and broken project's generated theme.compiled.css and the Data Widgets/Atlas versions next. That should narrow this down much faster than recreating the grid again.
Hope this helps.
One thing I'd verify is whether the browser is actually loading the DG2 stylesheet.
Open DevTools, inspect a row or cell, and check if classes like widget-datagrid-grid have the expected grid-related styles applied. If the classes exist but the corresponding CSS rules are missing, that usually points to a theme compilation or stylesheet loading issue rather than a Data Grid 2 configuration problem.
I've also seen this happen after pulling an older branch where files under theme/ were out of sync. In that case, running a full theme rebuild (npm install followed by a deployment directory clean and restart) resolved it.
Since even a brand new Data Grid 2 on a new page shows the same behavior, I would focus on project-level styling and theme assets rather than the widget itself.