I need to achieve layout like shown on my sketch.
- Multiple columns – user can adjust width
- Separated vertically into 2 zones – user can adjust heigth
- Each column will have multiple items inside – I will use List for that
Should I use Grid for this? Or DataGrid will be more appropriate? I afraid that Grid will give me issues with splitting the way I want but I wonder if DataGrid will be to “heavy” for such scenario?
Also, everything will be heavily styled so ease of doing it is important too.
EDIT:
Forgot to mention couple things:
- Number of columns will not be fixed but will be limited – up to 7
- I will inject views into those “cells”
- Is it possible to hide/show columns in MVVM scenario? I’m thinking if I use GridSplitter and bind splitter visibility then just because I can hide splitter and remove content from column if it’s “width” set to “Auto” – I will achieve scenario of “hiding” it.

IMHO, considering the number of columns is fixed,
Gridis the way to go here. You’ll need to have some logic to setMaxHeightof the first row so the user won’t be able to drag the horizontal splitter bellow the bottom of the grid (yes, I know, it should be the default behavior… :().Same goes for the
MaxWidthof each column. Only it’s more complex as you have to take into account the actual width of all columns. Also, you’d need to update the width of all columns when one of the vertical splitters is dragged, so the overall width of the grid stays the same.DataGridwill be overkill and you won’t gain nothing valuable – the vertical splitters will be taken care of, on first look – but then you have scroll bars that you have to consider, disabling them will mess with the ability to re-size columns. Also, the horizontal splitter will be available only in row header and not across all the width of the control. Moreover, calculating the height of the first row will have to be done manually, and then coerced somehow upon the data grid.Now that I think about it, I’d probably go with a custom panel (MyPanel) and a custom splitter (MySplitter) which inherits
Thumb.For the lists, I’d probably go with
HeaderedContentControland a custom control template.