You can accomplish this with nested Listviews. Here is a post that is for a situation similar to yours (I think) https://forum.mendix.com/link/questions/8615 Or just search the forum for Nested Listviews and you should find a number of other posts.
For a DataGrid this is impossible for as far as I know. However, you could use a TemplateGrid or ListView. These allow you to have an imput object (i.e. your "Rows") and let you fill each row with a DataView (e.g. Associated or through DataSource Microflow) which then serves as your "Column". It won't look like a DataGrid, however you could style it so that it mirror the effect.
Hope this helps you out.