Proportional Sizing (star sizing)

When a single row’s height or column’s width is set to *, it occupies all the remaining space.

When multiple rows or columns use *, the remaining space is divided equally between them.

Rows and columns can place a coefficient in front of the asterisk (like 2* or 5.5*) to take proportionately more space than other columns using the asterisk notation. A column with width 2* is always twice the width of a column with width * (which is 1*) in the same Grid. 

Percentage Sizing

Stretch = 100%

Otherwise you need to use the * star sizing, percentage values are not supported.

Grid cells background colour, padding, borders, etc

Background color and border

Add a Rectangle which stretches to fill the cell with the fill and stroke (border) you want.  Or you can use a Border element and set its BorderBrush appropriately (gives better performance).  Be sure to add these to the grid before adding any of the other children (or explicitly mark them with the ZIndex attached property), so their Z order puts them behind the main content.

Cell padding

Use autosizing and set the Margin on the child element.

 

 

Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *