Maybe this widget could help in defining a solution for your use case: https://marketplace.mendix.com/link/component/216495
One practical way to handle this is to use a helper / view-model entity.
In this approach, you create a non-persistent entity that is only used for the page. This entity represents one row in the grid, so usually one client = one helper object.
For example, if you have 3 clients, you create 3 helper objects.
Each helper object can contain:
So instead of trying to make the datagrid generate columns dynamically from the Stage entity, you prepare the row structure yourself in advance.
The flow usually looks like this:
First, when opening the page, run a microflow to prepare the data.
In that microflow:
Then use the list of helper objects as the datasource of the datagrid.
So your datagrid is no longer directly showing Client or Stage data.
It is showing the prepared helper rows.
A simple example:
If you have:
and stages:
then your helper entity might look like this:
In the UI:
This makes the datagrid easy to build because the columns are fixed.
This solution works best when the number of stages is known and limited.
For example, if you always have 2, 3, or 5 stages, this is manageable.
But if users can add or remove stages at runtime, this becomes difficult, because every new stage would require:
If you also need to save changes back to the database, then after the user edits the helper row values, you can run another microflow that:
So in short, this option works by using the helper entity as a UI layer between the page and the real data model.
If this resolves your issue, please mark it as accepted.