Using Data grid you can create Rows but not columns
You can use this Dynamic (Tree) Table widget in the form of a grid. It supports dynamic columns which you may retrieve from a microflow.
https://marketplace.mendix.com/link/component/112555
Hope this helps!