This is probably more of a general WPF question, but I know as soon as I mention a xam grid, they'll simply refer me back here.
I'm struggling, trying to igure out the right combination of containers to use when groupping two xamgrids. I had this working in a simple grid, but now I'm trying to use expanders. Not to get side tracked, but to head of responses of "don't use an expander", I'm doing this for UI consistency. The expander in this case has a style that prevents collapse, while the group looks similar to other expanders on the page that can collapse.
Anyway, what I'm running into xamgrids that run off the bottom of the expander control (the grid opens and the items dissapear from the bottom, with no scroll bar). I can't figure out how to tell the xamgrids to consume only as much vertical space as is available on the screen. It seems that the expander is virtual, even though it doesn't scroll.
A basic version of what I need is:
<expander>
<grid>
[row defs ... 2 rows]
<xamgrid grid.row="0"></xamgrid>
<splitter grid.row="0"></splitter>
<xamgrid grid.row="1"></xamgrid>
</expander>
This, of course, doesn't work correctly for me, as described above.
I've been experimenting with this some more, but it's still a bit of a mystery, how these controls get their sizing and scrolling behaviors.
If I put a grid inside the expander with 3 rows (the middle for a splitter), I get "reasonable" behavior. Empty grids look strange and dragging the sizer UP resizes the expander vertically, in the opposite direction (gets taller). Again, that's with the grids empty. I also get situations where empty grids show column labels, which looks strange because when there is any dat in them at all, group by records are shown instead. With fully populated grids, it's OK, but the overall look and feel with one or more empty grids is a bit rough around the edges. I guess I'd like to figure out how to show "NO DATA" messages in place of the strange looking empty grids until data is present. That might solve several issues.
Also, I have found no way to provide grid captions or titles in this layout. If I throw in a textblock, it gets superimposed with the xamgrid. If I surround the two with a stackpanel, I get the invalid scrolling behavior, wherein the xamgrid won't show scrollbars, but rather expands down out of view, pushing other controls out of view, as well.
<Expander Name="x"
IsExpanded="True"
Header="GRID AREA">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" MinHeight="100"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<igDP:XamDataGrid
Try binding the height of the xamDataGrid to the ActualHeight of it's parent Grid control.