Datagrid2 performance workarounds

0
We're in the middle of converting old datagrids to datagrid 2. There are cases where pages used to load instantly, while with Datagrid2 (with the same sorting, xpaths and columns etc) it takes like 8+ seconds. Any hints, workarounds, things to avoid or refactor? I've tried for example removing the sorting, dropdown searches and columns over associations, but that doesn't make much of a difference.
asked
2 answers
1

hi,


Yes, this is a well-known behavior when moving from classic Data Grid → Data Grid 2. Even with the same XPath and columns, Data Grid 2 has a higher initial cost by design.

Why Data Grid 2 is slower on first load

Data Grid 2 does much more work upfront than the old grid:

  • Builds a virtualized React table
  • Initializes column models, filters, sorting state
  • Evaluates column visibility, personalization, resizing
  • Prepares client-side state, even if features are unused

So pages that were “instant” before can easily take 5–10 seconds now, especially with:

  • Large datasets
  • Complex access rules
  • Many columns (even hidden ones)

This is expected and documented behavior.

What actually helps (proven in projects)

1.Reduce initial dataset size (biggest win)

Even if paging is enabled, DG2 still does heavy initialization.

✔ Always:

  • Add a strict XPath constraint
  • Load only what’s needed for the first view
  • Avoid “load everything + filter later”

If possible:

  • Use a microflow datasource and return a limited list first

2.Minimize column count (hidden columns still cost)

In Data Grid 2:

  • Hidden columns are still processed

So:

  • Remove unused columns completely
  • Don’t rely on “hide column” for performance

3.Disable features you don’t need

Explicitly turn off:

  • Column personalization
  • Column resizing
  • Grid-wide filtering
  • Multi-select (if unused)

Each feature adds client-side overhead.

4.Avoid deep associations in columns

Columns over associations are much more expensive in DG2 than classic grid.

Best practice:

  • Flatten data via:
    • Calculated attributes
    • Before-commit logic
    • Microflow datasource projection

5.Keep DG2 off the landing page

Never load a heavy Data Grid 2:

  • On the home page
  • As the first page after login

Navigate to it only after the app has initialized.

What does NOT help (common traps)

Removing sorting alone

Disabling dropdown filters only

Expecting DG2 to behave like classic grid
Client-side tweaks


answered
0

I would suggest to focus on one slow data grid and try to make an implementation using view - entities.

https://docs.mendix.com/refguide/view-entities/

This is based on OQL queries, it should allow you to keep all your filters and sortings but it will render much faster because OQL offers massive performance enhancements!

Hope this helps!

answered