How do I have a gridview with some cells that span columns? I have several datasets that need to be dynamically loaded (so grid layout is not what I need) and visually presented in a GridView in various ways. Below is a graphical representation of what I can achieve, 'x' shows cells that display something, and empty cells show nothing

With what I have, in the center there is an ugly cell when I want to display 4 elements in the same row.
I want 5 elements to be displayed on one line and 4 elements on the other, etc. The figure below shows what I want to achieve

Gridview, . gridview. , gridview, .