How are child controls made to appear in order within a xaml Grid?
For e.g., using the following:
<Grid>
<igRibbon:XamRibbon...>
<igWindows:XamTabControl...>
<igWindows:XamTabControl...>
</Grid>
I would like the
- ribbon to appear at the top of the window
- followed by the 2 XamTabControls in order
But, my XamTabControl seems to stretch occupying the whole window hiding the XamRibbon.
Tried the following:
I’m sure this is not very tricky or difficult, but I couldn’t find a proper control/property that needs to be set. I tried setting Grid.Row="1" (for the first XamTabControl), but that seemed to make no difference.
Solution 1
By default controls will stretch to fit the size of the grid cell. To fix this you can either define more than one grid row / column through something like …
Then you can explicitly set which column and row you want each control in via the Grid.Row and Grid.Column attached properties. You can specify a height / width of the column / row, or leave that part out and they will default to being uniform.
If the
Heightof the first row is set to the valueAuto, it distributes height evenly based on the size of the content that is within that row.Solution 2
Or change the vertical and horizontal alignment of each control inside from stretch to some other value.
Solution 3
A third solution could be change the
<Grid>to a<UniformGrid>